Few days ago i was on interview and I had one task to do with, to me, unknown use of increment. It goes exactly like this:
echo $x+++$x++;
I've never seen something like this before, I'm trying to figure out what it does and I'm clueless. To check it i wrote such code sample:
<?php
$x = 7;
echo $x. "<br>";
echo $x+++$x++;
?>
First line prints out what it is supposed to print out: 7
.
But second line prints out 15
. Why? How does this thing work? What does it mean?
Is it just me or is it similar thing as variable variable which is funny task from interviewers but is not useful in reality?