332 Followers
320 Following
940 Posts
Static code analysis maestro @Exakat #PHP expert elePHPant breeder. https://linktr.ee/exakat
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.

#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

Old elePHPant meeting future delta robot elePHPant #dpc
I don’t use ai generated image but when i do, it shows #dpc 😂

#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

Testing context contamination #confoo with Gemeni, and I'm getting that nugget of truth about #PHP. Mixed feeling.