#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
| PHP | |
| Exakat | |
| Code audit |
#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
#PHP puzzle of the day: can you make Chidren::foo() call GrandParents::foo() ?
Think about it, and then, click below for the solution(s).
Would it be cool to have a #PHP ::parent operator, like we have the ::class operator
Well, turns out we can.
https://php-tips.readthedocs.io/en/latest/tips/parent_operator.html
OK, I'm tired and this #PHP make me chuckle.
https://php-tips.readthedocs.io/en/latest/tips/stuttering.html
So, #PHP typed class constants are vaguely useful?
Here is a nice usage case that will definitely makes everyone love them.
https://php-tips.readthedocs.io/en/latest/tips/crazy_const_type.html