strict_types Exceptions

no-email (Damien Seguy), Damien Seguy
Tue, 20 Sep 2022 00:00:00 +0000

strict_types do not apply to PHP operators, only on to typed structures.
Here, concatenation and interpolation all call __toString(), but not foo().
As you can see, print() and echo() are safe too, while implode() is not: actually, it is not safe for the first argument, but still OK with the elements of the array, in the second argument.