Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy parsing for array, structured and json types #892

Open
Tigrov opened this issue Oct 19, 2024 · 3 comments
Open

Lazy parsing for array, structured and json types #892

Tigrov opened this issue Oct 19, 2024 · 3 comments
Labels
type:feature New feature

Comments

@Tigrov
Copy link
Member

Tigrov commented Oct 19, 2024

Suggested to store in ArrayExpression, StructuredExpression and JsonExpression the string value retrieved from the database and convert it to an array or other PHP representation as the data is accessed.

This will save resources if the data is not used during execution.

Can be optionally.

@samdark
Copy link
Member

samdark commented Oct 20, 2024

Sounds good from a performance perspective. The only thing is that checks such as is_array would become instanceof ArrayResult or something alike.

@samdark samdark added the type:feature New feature label Oct 20, 2024
@Tigrov
Copy link
Member Author

Tigrov commented Oct 20, 2024

Actually I think about ArrayExpression which already realizes ArrayAccess, Countable and IteratorAggregate interfaces and the check should be is_iterable().

@samdark
Copy link
Member

samdark commented Oct 21, 2024

Expression is logically an input. Not sure it is a good idea to reuse for results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants