#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.

#phptip #phptrick

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() ?

#phptip #phptrick

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).

#phptip #phptrick

https://www.exakat.io/calling-all-ancestors/

Would it be cool to have a #PHP ::parent operator, like we have the ::class operator

Well, turns out we can.

#phptip #phptrick

https://php-tips.readthedocs.io/en/latest/tips/parent_operator.html

Can you make this #PHP riddle running?

This compiles, so you can only add more code to make it work.

I asked 5 AI, 2 succeeded, 3 failed.

#phptip #phptrick

So, #PHP typed class constants are vaguely useful?

Here is a nice usage case that will definitely makes everyone love them.

#phptip #phptrick

https://php-tips.readthedocs.io/en/latest/tips/crazy_const_type.html

#PHP numeric separator works well on integer, floats and also hexadecimals, octals and ... binary. And most useful in the latter, right?

0b1111_00_111_101_111

#phptip #phptrick

https://php-tips.readthedocs.io/en/latest/tips/hexadecimal_separator.html

Recap of a journey to refactor strings to #PHP enumerations, and some of the met challenges.

#phptrip #phptip

https://www.exakat.io/refactoring-strings-to-enums/

What do you think this #PHP code will write?
Could we do better ?

#phptip #phptrick

https://php-tips.readthedocs.io/en/latest/tips/errorNumber.html