@dseguy@phpc.social
@dseguy@phpc.social avatar

dseguy

@dseguy@phpc.social

Static code analysis maestro https://phpc.social/@Exakat #PHP expert elePHPant breeder

This profile is from a federated server and may be incomplete. Browse more on the original instance.

dseguy, to php French
@dseguy@phpc.social avatar

Useless tip of the day:

Null and booleans accept the array syntax, but always return NULL (and a warning)

Illegal types for array keys lead to a Fatal Error.

But not with NULL and booleans.

https://php-tips.readthedocs.io/en/latest/tips/nullAsArray.html

dseguy,
@dseguy@phpc.social avatar

How come [][[]] is a lintable syntax is a still a mystery to me.

dseguy,
@dseguy@phpc.social avatar

@wyri Which []? There are too many of them!

It is a fatal error, no type juggling. You need to force (cast) the type to make this to run.

array()[ array() ] is at least a bit more readable. 😂

Crell, to random
@Crell@phpc.social avatar

This is way more gripping than it has any right to be...

https://www.youtube.com/watch?v=GuJ5UuknsHU

dseguy,
@dseguy@phpc.social avatar

@Crell That is incredible from the start....

dseguy, to php French
@dseguy@phpc.social avatar

Lifes of elephpants: the epic life of Flexy the elephpant. Come and read a whole year with an elephpant, from its conception to its arrival in the community.

An ode to all of you who are considering becoming !

https://www.exakat.io/en/lives-of-elephpant-the-story-of-flexy/

dseguy, to php French
@dseguy@phpc.social avatar

8.2 has the #[SensitiveParameter] attribute that hides values in debug messages.

There is also the SensitiveParameterValue class, that does the same, while working from the caller perspective. Get the value with $object->getValue()

https://3v4l.org/KrViH

https://www.php.net/manual/en/class.sensitiveparameter.php

tvbeek, to random
@tvbeek@phpc.social avatar

@dseguy thank you for presenting Those changed behaviors in PHP 8.0+ on the meetup in Eindhoven! It gave some nice insights.

dseguy,
@dseguy@phpc.social avatar

@tvbeek Thanks for organising the Eindhoven group.

I wish we can soon make a new picture and troll you-know-who 😂

wyri, (edited ) to php
@wyri@haxim.us avatar

Rethinking configuration for my / client generator while transforming it into a package generator. Currently using hydrating into classes. Mainly looking to support both those wanting to keep it simple and those with complex setups without to much duplication.

dseguy,
@dseguy@phpc.social avatar

@wyri I think you could also consider INI, TOML, JSON.

I also have that kind of question on a regular basis. This is where the feature (read a config file) and the format (well... all of those above) have to be decoupled.

There could be a package that handle all those formats (modular), apply some validations (optional) and deliver a pre-defined class. Also, write to those formats.

That would be a very useful package.

dseguy,
@dseguy@phpc.social avatar

@wyri @jaapio Switching that way is an important organic evolution, that follows the maturation of the code.

And then, the rest is a matter of decoupling from preferences. Such package would read any valid format, until that format doesn't fit requirements.

dseguy, to php French
@dseguy@phpc.social avatar

I scream, you scream, we all scream for @ no scream operator: a usage review of the @ operator in code, when to use it and when not to use it.

https://www.exakat.io/en/i-scream-you-scream-we-all-scream-for/

dseguy, to random French
@dseguy@phpc.social avatar

Running @Exakat on an application server will make it faster and more flexible. And there comes FrankenPHP!

Here is the port of a complex CLI intensive application on FrankenPHP, and make it run. It was both teaching and straightforward.

https://www.exakat.io/en/exakat-on-frankenphp/

dseguy, to php French
@dseguy@phpc.social avatar

is better than me : I thought I found a way to create properties in an interface, by declaring promoted properties in a constructor.

Someone coding the PHP engine was smarter than me : it feels so good! (BTW, who would that be?)

It's also going to save me some sanity, as I don't have to upgrade my Static Analysis Engine.

dseguy,
@dseguy@phpc.social avatar

@Girgias @nikic Thank you Nikita!

dseguy,
@dseguy@phpc.social avatar

@velkuns Always keep thinking, that's the way to go!

elazar, to random
@elazar@phpc.social avatar

Saturday Morning Breakfast Cereal - Odd
https://www.smbc-comics.com/comic/odd

dseguy,
@dseguy@phpc.social avatar

@elazar I will certainly mis-quote it and say that 'Everything works, and nothing is elegant : God is an coder'.

wyri, to php
@wyri@haxim.us avatar

@dseguy it was a honor getting banned from questions together with @jrf_nl during the Amsterdam meetup today 😎

dseguy,
@dseguy@phpc.social avatar

@mwop @wyri I always ban the most chatty in the audience, so that others can also ask questions later.

I also only ban people I like. 😜

dseguy,
@dseguy@phpc.social avatar

@wyri @mwop @jrf_nl I still managed to surprise you here and there.

dseguy, to php French
@dseguy@phpc.social avatar

We had a great night @amsterdamphp discussing the changed behaviors in 8. Thanks Frank and Bas for the invitation.

We skipped some changed behaviors in the list of 125, and they are listed there : https://php-changed-behaviors.readthedocs.io/en/latest/

Tell me the one I missed!

dseguy, to random French
@dseguy@phpc.social avatar

@jrf_nl en route, for 5pm

dseguy, to php French
@dseguy@phpc.social avatar

Quizz : when is it useful to add the same trait t in a parent AND in a child class ?

dseguy,
@dseguy@phpc.social avatar

@Deuchnord That is definitely one. Class implementation has precedence, so T might be overwritten by A, but still needed by B.

This is good! And I have a another use case.

dseguy, to php French
@dseguy@phpc.social avatar

When using the null safe operator ?-> , note that the checks are still necessary, and that it also impacts the types of the methods involved.

It is a significant change with -> which needs pre-checks.

https://www.exakat.io/en/null-safe-operator-in-practice/

dseguy,
@dseguy@phpc.social avatar

@amarok I also prefer to get the Fatal error upfront, in dev, so I can fix it, rather than moving the check AFTER the call.

I am more concerned about the 'null safe operator will remove bloat from your code', while it mostly moves it around.

heiglandreas, to random
@heiglandreas@phpc.social avatar

Have a great day, @dseguy! I'm sure there'll be 🍰 and ☕ and perhaps even an :elephpant:

dseguy,
@dseguy@phpc.social avatar

@heiglandreas My daughters literally littered (!!) the living room of elephpants with little party hats. That was extremely festive atmosphere!

Danke Schon!

EricHogue, to random

Bonne fête @dseguy !

dseguy,
@dseguy@phpc.social avatar

@EricHogue bah, alors je passe à Montréal. 😎

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • rosin
  • thenastyranch
  • GTA5RPClips
  • tester
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • kavyap
  • megavids
  • cisconetworking
  • khanakhh
  • normalnudes
  • osvaldo12
  • tacticalgear
  • anitta
  • Durango
  • ethstaker
  • modclub
  • Leos
  • provamag3
  • cubers
  • lostlight
  • All magazines