What happens when you chain #PHP list() calls?
And when you include a full assignement in the middle?
Also, with #PHP 8.6 deprecating the list keyword, modern code likes like chains of arrays.
#phptip #phptrickhttps://php-tips.readthedocs.io/en/latest/tips/list_or_array.html
#phptip
5 posts · Last used 18d
Replying to
@alister@hachyderm.io #phptip #phptrick Quite an evil piece of syntax! This goes to the PHP tips archive!
Pop quizz #PHP on Friday evening:
How can you remove an argument between the parent class and the child class? Is that an impossible task?
#phptip #phptrickhttps://php-tips.readthedocs.io/en/latest/tips/less_arguments.html
#PHP 8.4 introduced array_find() to look for a value in an array, and also, its cousin, array_find_key(), which returns the key where to find that value.
The second got less attention, but is arguably more useful.
#phptip #phptrickhttps://php-tips.readthedocs.io/en/latest/tipSection.html
So, it seems that it is possible to paint oneself in a corner and write an unreachable method. How would you call A::foo() in this code below?
Come on, #PHP, there must be something here.
#phptip #phptrick
https://php-tips.readthedocs.io/en/latest/tips/unreachable_method.html
You've seen all posts
