Advertisement · 728 × 90

Posts by Damien Seguy

Post image

#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/latest/ti...

6 days ago 1 1 0 0
Post image

#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/latest/ti...

6 days ago 1 1 0 0

Any detailled thoughts about the cleaner code with property hooks? I tend to agree, thought I feel the impact more than I see it.

1 week ago 0 0 0 0
2nPL6 - created on 3v4l.org View the output of this script on 3v4l.org: the online PHP shell with 250+ PHP versions

I added the second situation from your code here: It makes the example long, but still readable.
3v4l.org/2nPL6

Also, I tried with promoted properties, and it has no impact: so different behavior. Geez... #PHP ...
3v4l.org/E6G8f#veol

1 week ago 2 0 1 0

I always thought that the order of properties in a #PHP class didn't matter, but that's not true. It does matter when comparing two instances of the same class. Each property is evaluated one after another in the order they were declared until the first difference is found. 3v4l.org/NTP5c

1 week ago 6 1 1 1
Preview
PHP - Lemmy.World <? namespace lemmy\php; /* Welcome to the PHP community on Lemmy #Rules: 1: Soon™ #Helpful stuff: PHP Documentation [https://www.php.net/docs.php] Composer [https://getcomposer.org/doc/00-intro.md] PHP Standards [https://www.php-fig.org/psr/] #Common frameworks: Symfony [https://symfony.com/doc/current/getting_started/index.html] Larvel [https://laravel.com/docs/] */ echo “Welcome”;

#PHP news: lemmy.world/c/php?dataTy...

1 week ago 0 0 0 0

#phptip #phptrick

1 week ago 0 0 0 0
Post image

header_register_callback() registers a function that fires just before headers are sent.

After ALL your code runs. After ALL output buffering. Before the first byte goes to the client.

Last chance to add headers, and last chance to change the status code!

There is no later hook in #PHP than this.

2 weeks ago 4 1 0 0
Advertisement
Preview
Terminal Trove - The $HOME of all things in the terminal. Terminal Trove showcases the best of the terminal, Discover a collection of CLI, TUI, and more developer tools at Terminal Trove.

Terminal Trove – Le catalogue incontournable des outils en ligne de commande

2 weeks ago 3 1 0 0
Prepare for PHP 9: A tour of all PHP 8 Deprecations by Damien Seguy
Prepare for PHP 9: A tour of all PHP 8 Deprecations by Damien Seguy YouTube video by Dutch PHP Conference

All #PHP developers should watch this talk by @dseguy.bsky.social to prepare their codebases for the future

youtu.be/T5wQn57Zhkw?...

2 weeks ago 4 1 0 1
Post image

Gagne ta place pour l'@afup.org Day 2026 ! 🥳

L'événement a lieu à Bordeaux, Lyon et Lille, vendredi 22 mai !

Pour jouer :
- Rejoins notre Discord : humancoders.com/pages/discord
- Précise la ville pour laquelle tu participes
- Les gagnant·e·s seront annoncé·e·s sur Discord le 24 avril

2 weeks ago 4 5 1 0
Post image

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/latest/ti...

2 weeks ago 0 0 0 0
Post image

I’m always moved when a young elePHPant meets Trisaieul, the great grand parent of all elephpants.

Thanks Tideways for making this reunion possible.

Moni: welcome to the PHPamily!

3 weeks ago 0 0 0 0
Post image

#PHP defined() in action: there are many aspects when checking for a constant existence.

#phptip #phptrick

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

3 weeks ago 0 0 0 0
Preview
Welcoming Matt Stauffer to The PHP Foundation Board The PHP Foundation — Supporting, Advancing, and Developing the PHP Language

We are very happy to welcome Matt Stauffer as the newest Board member for The PHP Foundation! Matt brings decades of experience and we are grateful for his insight as we move forward.

Welcome, Matt! 🤩 🐘 🚀

Read more: thephp.foundation/blog/2026/03...

#php #thephpfoundation #phpc

3 weeks ago 25 6 0 3
Advertisement

Et fait des encoches à gauche pour les rendre double face?

3 weeks ago 1 0 1 0
Preview
Renaming Parameters in a method - Exakat Renaming Parameters in a method is a classic challenge in PHP code: with PHP 8.0 named parameter, new strategies are need to refactor it.

3 strategies to rename parameters in a #PHP method

www.exakat.io/renaming-par...

3 weeks ago 1 0 0 0
Post image

I owe this one to @faguo!

In #PHP, expm1() computes exp(x) - 1.
log1p() computes log(1 + x).

"Why not just write exp($x) - 1" you may ask...

Because when x is close to 0, floating point eats your precision alive. Think about it if you deal with finance!

4 weeks ago 4 3 0 0
Human Creations — Derick Rethans

I've published a new blog post: "Human Creations", on the difference in content generation by LLMs, and the creation of text, art and code by humans.

You can find it at https://derickrethans.nl/human-creations.html or at @blog

#writing #ai #content #fediverse #MadeByHumans

4 weeks ago 6 5 0 2
Post image

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/latest/ti...

4 weeks ago 0 0 0 0
Preview
Current PHP RFCs in Voting Phase (March 2026) - Exakat Current PHP RFCs in Voting Phase: PHP licence, BC breaks with types policy, DocComments, enum for sorting, fetching array keys.

Current #PHP RFCs in voting phases (March 2026)

See what will come to #PHP 8.6

www.exakat.io/current-php-...

4 weeks ago 0 0 0 0
Preview
ReturnTypeWillChange Is For All ``ReturnTypeWillChange`` is an attribute that tells PHP that the return type of the related method is different from the defined by the PHP native methods

#[ReturnTypeWillChange] works on native #PHP methods and also on custom ones.

#phptrick #phptip

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

4 weeks ago 0 0 0 0
Post image

#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/latest/ti...

1 month ago 0 0 0 0
Post image

What kind of PHP developer are you? 🤔

1 month ago 4 1 2 0
Advertisement
Preview
::parent Operator PHP provides the ``X::class`` operator to access a class's fully qualified name

A ::parent operator in #php?

#phptip #phptrick

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

1 month ago 0 0 0 0
Les PHP, protecteurs de hautes personnalités Pour r&eacute;pondre &agrave; des sollicitations de plus en plus nombreuses, la FSP (Force S&eacute;curit&eacute; Protection du GIGN) peut compter sur les PHP (Protection de Haute Personnalit&eacute;)...

#PHP, Protecteurs de Hautes Personnalités,

carrément sur le site du ministère de l'intérieur.

www.gendarmerie.interieur.gouv.fr/gendinfo/dos...

1 month ago 3 0 0 0

What is the expected impact? 10% speed up of implode() calls?

1 month ago 1 0 0 0
<?php

const from = ['yield from'];

$a = fn () => yield yield from from;

foreach($a() as $b) {
    print $b;
}

<?php const from = ['yield from']; $a = fn () => yield yield from from; foreach($a() as $b) { print $b; }

OK, I'm tired and this #PHP make me chuckle.

#phptip #phptrick

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

1 month ago 2 0 0 0

😂 good inspiration ideas …

1 month ago 0 0 0 0

Any 3v4l.org link to share?

1 month ago 0 0 1 0