29
On the web I came across the following piece of code:
echo 1...1;
Resulting in 10.1
. I did the var_dump
of the same and the return is:
string(4) "10.1"
Works with variable assignment:
$x = 1...1;
echo $x; // 10.1
And for other values:
echo 2...2; // 20.2
echo 1...1; // 10.2
echo 3...2; // 30.2
I know that in PHP 5.6+ there is the operator ...
(splat Operator), that extracts the values of a array - similar to the *
Python - but it doesn’t seem to be the case, because, according to the site 3V4L, the result is the same since version 4.3.0, that there was no such operator.
Apparently it only works with integers.
Would be some implicit value concatenation that PHP does?
Poor thing about PHP.
– Jéf Bueno
I never cease to amaze myself with PHP :)
– Artur Trapp
What a tragedy, every day I discover a new.
– Maniero
Crendeuspai. I’ve said it more than once and I repeat: If I wasn’t forced to work with PHP, I would have quit long ago. It seems that the pattern of things with PHP is Undefined behavior or confusing syntax.
– nmindz
As for mimimi, the answer has already clarified :p
– Wallace Maxters