On the web I came across the following code snippet:
echo 1...1;
Resulting in 10.1
. I made the var_dump
of it 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 ), which extracts the values of an array - similar to *
of Python - but it does not seem to be the case, why, 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 it be some implicit concatenation of values that PHP does?