Skip to content

Best way to mix array<string, mixed> with array shape #5703

Discussion options

You must be logged in to vote

If you can somehow deduce from 'SELECT id, name FROM users' how the array shape will look like, you can write a dynamic return type extension that will do it: https://phpstan.org/developing-extensions/dynamic-return-type-extensions

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ondrejmirtes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants