Benoit Viguier

92 Followers
72 Following
263 Posts
Developer
// print_r($this)
// TODO: update this comment
France - Lyon
https://b-viguier.github.io

Très content d’avoir été retenu pour le #forumPhp !
J’y présenterai 2 sujets courts:
« Le grand cycle de la vie (d’une variable) » et « Écrire du Php avec seulement 6 caractères ».
Hâte de retrouver la communauté, merci @afup

https://event.afup.org/forum-php-2024/programme/

Programme – Forum PHP 2024 – Cycles de conférences AFUP

Découvrez le programme du Forum PHP 2024

What will display this #PHP code?

No idea why someone could want to do that… but still interesting 😅

(Answer 🤫 https://3v4l.org/i7lf7#v8.2.11 )

i7lf7 - created on 3v4l.org

View the output of this script on 3v4l.org: the online PHP shell with 250+ PHP versions

Mood… 😩

A small #PHP trick, combining named parameters, spread and union arrays operators to « easily » create a modified copy of a DTO: https://3v4l.org/ZWX5G#v8.2.10

⚠️ It’s fun if you have a lot of parameters, but using a string containing the parameter’s name isn’t really satisfactory 😕

ZWX5G - created on 3v4l.org

View the output of this script on 3v4l.org: the online PHP shell with 250+ PHP versions

In #PHP, remember that « readonly » doesn’t necessarily imply immutability ⚠
Objects and references can be tricky…

https://3v4l.org/9ftoX#v8.2.9

Readonly != Immutable - created on 3v4l.org

View the output of this script on 3v4l.org: the online PHP shell with 250+ PHP versions

J’aurai le plaisir de vous retrouver au #ForumPhp pour parler de frameworks asynchrones: ReactPhp Amp et Revolt ⚡️
Hâte de retrouver toute la communauté! 🐘
Merci à l’@afup pour sa confiance, et pour l’organisation de ce super évènement 🥳

https://event.afup.org/forum-php-2023/programme/

#PHP tip: array_column function can also return a list of objects properties. Very useful now that we can create readonly properties in DTO

https://www.php.net/manual/en/function.array-column

https://3v4l.org/8Xrts#uv8.2.7

PHP: array_column - Manual