home.social

#phptip — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #phptip, aggregated by home.social.

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

  11. 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!

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

  12. 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!

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

  13. 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!

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

  14. 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!

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

  15. 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!

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    php-tips.readthedocs.io/en/lat

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

    exakat.io/calling-all-ancestor

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

    exakat.io/calling-all-ancestor

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

    exakat.io/calling-all-ancestor

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

    exakat.io/calling-all-ancestor

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

    exakat.io/calling-all-ancestor

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

    Well, turns out we can.

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    Well, turns out we can.

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    Well, turns out we can.

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    Well, turns out we can.

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat

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

    Well, turns out we can.

    #phptip #phptrick

    php-tips.readthedocs.io/en/lat