Damien Seguy
banner
dseguy.bsky.social
Damien Seguy
@dseguy.bsky.social
Code quality fanatic, static analysis expert @exakat, elephpant breeder, husband, father, speaker!
Reposted by Damien Seguy
Devs de Lille et des environs, rejoignez la communauté ce soir au Bar Hôpi pour un dernier verre avec l'AFUP Hauts-de-France avant la nouvelle année ! Il est encore temps de vous inscrire pour une soirée en bonne compagnie.
buff.ly/L7yJmWw
December 17, 2025 at 10:16 AM
Can a #PHP class have two methods with the same name?

Not with signature overloading, a classic feature, right?
But rather one method static and the other one non-static?

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
December 15, 2025 at 10:23 AM
Reposted by Damien Seguy
C'est le deuxième jour de @osxp2023.bsky.social et on parle de tout #php #drupal #firefox #commonvoire... et vous me trouverez sur le stand @drupal.fr @mozilla-fr.bsky.social au village associatif
December 11, 2025 at 5:39 AM
Do you think that intval() is a boring #PHP native function that turns string into integers?

Well, it does, but it is not boring. Far from it!

php-tips.readthedocs.io/en/latest/ti...

#phptip #phptrick
December 8, 2025 at 8:43 PM
November 20th, 2025: PHP 8.5 arrives! 🐘

We’re throwing a release party at PHP Rotterdam, and you’re invited!

Expect PHPun, knowledge-sharing, and great company at Last Mile Solutions!

eventy.io/events/q8lmw...

#PHP #PHP85 #Community #Rotterdam #Developers
November 6, 2025 at 6:05 AM
Reposted by Damien Seguy
Cette année votre antenne préférée (nous 🤫) vous propose un AFUP Day à Bordeaux !

What's next?
Les CFPs sont ouverts jusqu'au 10 Novembre 2025 par ici 👉 event.afup.org
Et la billetterie est ouverte aussi par ici 👉 event.afup.org
⚠ Les tarifs "les yeux fermés" sont limités

See you there!
October 13, 2025 at 3:33 PM
I can get phpstan elephpants at #IPC Munich. Do you want one too?
Send me a DM to book one (30 e, delivery by CPS)
Deadline : Wednesday 29th October.
October 28, 2025 at 5:09 PM
Reposted by Damien Seguy
I had the opportunity to chat with @asgrim.dev yesterday about PHP Pie - the new installer for PHP extensions, intended to replace PECL.

Full interview dropping tomorrow.
October 22, 2025 at 2:06 PM
It is easy to create a map from a list of object, using #PHP array_column() and the second argument null.

That null represents the whole object, and the third argument is the indexing key.

array_column($list_of_objects, null, 'id');

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
October 22, 2025 at 12:47 PM
It is not possible to cast any #PHP enum cases to (string) or (int) even when... they are backed!

That looks like a natural feature, though.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
October 2, 2025 at 8:28 PM
Dynamic class constants is achieved with #PHP 8.3 class constant syntax, and the constant() function.

It also applies to enumeration cases.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
October 1, 2025 at 8:52 PM
I ran into a 2011 #PHP ASCII art generator, and the code works perfectly on PHP 8.5.

donatstudios.com/Damn-Simple-...
Damn Simple PHP ASCII ART Generator
donatstudios.com
September 26, 2025 at 7:07 PM
#PHP callable arrays are checked for 2 elements and only using index 0 and 1.

No one said that 0 and 1 have to be in that order, and it works perfectly!

Well done #PHP, well done!

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
September 21, 2025 at 5:06 PM
There are, at least, 4 ways to create a closure in #PHP. They all will be callable later.

On the other hand, they behave differently to check the underlying method.

All is in the timing.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
September 19, 2025 at 7:16 PM
A few days ago, I warned about isset() and a possible #PHP Fatal error.

Given that isset() and ?? share the same code, it is not suprising that ?? hold the same trap.

That bug should go away, the sooner the beter.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
September 18, 2025 at 8:16 PM
When using #PHP isset(), the language construct hides errors because, that's what is being tested there.

Unless there is an object, where an array is expected. Then, it leads to a fatal error.

It prevents the usage of an optimisation.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
September 15, 2025 at 6:50 PM
It is Friday, so why not cram as many #PHP operators in one single operation, and make it work?

Look at this beauty! Could you make it run?

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
September 5, 2025 at 8:23 PM
A rare find: A syntax that worked before #PHP 8.1 and after #PHP 8.2 but not in #PHP 8.1

Here is the never arrow function.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
August 27, 2025 at 3:33 PM
Reposted by Damien Seguy
You enjoyed the thread about "unadvertised" features of the upcoming #PHP 8.5 release? 🤩

Let's do it again with the latest released version, PHP 8.4, for all #Symfony/#Laravel/vanilla PHP fans 🚀

Here are 11 FEATURES you probably don't know about the current PHP version 🧵👇
July 18, 2025 at 7:44 AM
So, take a #PHP array, but some value in it (like, anything).

Can you make an infinite loop out of this?

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
July 3, 2025 at 6:12 PM
#PHP properties may be a reference.
#PHP properties may be promoted.
#PHP properties may have a hook.

Just not both at the same time.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
June 29, 2025 at 10:35 AM
#PHP mixed type accepts any type, just like no type. But it is also making property unreadable before initialisation.

And that's often a useful check.

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
mixed Is Not No Type
When a property is not typed, nor has a default value, it still may be accessed freely: its value is ``null``
php-tips.readthedocs.io
June 27, 2025 at 2:30 PM
In #PHP array_merge_recursive(), what is recursive?

Does it go deep in the guts of the arrays, or does it merges values that look alike?

Or something else?

#phptip #phptrick

php-tips.readthedocs.io/en/latest/ti...
June 25, 2025 at 8:36 PM