Yield or return, when using ... in a function call?
Not an easy question to ask on a first date.
https://php-tips.readthedocs.io/en/latest/tips/yield_or_return.html
Yield or return, when using ... in a function call?
Not an easy question to ask on a first date.
https://php-tips.readthedocs.io/en/latest/tips/yield_or_return.html
Passing array by value, and updating its elements.
Nothing new, it is the readonly and array_fill() syndrom for arrays. Better know about it.
https://php-tips.readthedocs.io/en/latest/tips/array_by_value.html
#PHP quiz of the day: how can a property be both not set, empty() and failing at comparison with falsy value?
And more than one of us has this bug ATM.
https://php-tips.readthedocs.io/en/latest/tips/not_set_but_exists.html
New word: zombie closure
That is when you put $this in a static closure, you can run the #PHP code but you can't call it.
Just a reminder about static arrow functions.
https://php-tips.readthedocs.io/en/latest/tips/static_arrow_function.html
#PHP defined() in action: there are many aspects when checking for a constant existence.
preg_split() splits #PHP strings with regexes, captures the separators and can handle an empty regex.
You don't need that everyday, but when you do, #PHP has it!
https://php-tips.readthedocs.io/en/latest/tips/preg_split.html
#[ReturnTypeWillChange] works on native #PHP methods and also on custom ones.
https://php-tips.readthedocs.io/en/latest/tips/returntypewillchange_for_all.html
#PHP's NAN is 0 as an integer, 'NAN' as a string and not comparable with itself.
Also, there are now warning when using them, so no one can get hurt by this.
https://php-tips.readthedocs.io/en/latest/tips/compare_nan.html
Enumerations are backed by strings, they work with in_array(), but not with array_unique()
Well, at least, not directly.
Also, did you know Enum::cases() ?
https://php-tips.readthedocs.io/en/latest/tips/array_unique_and_enum.html