How this is evaluated in PHP
<p>While reading some questions on PHP. I read one question with it's answer as follows :</p>

<p>What will be the output of the code below and why?</p>

<pre><code>$x = 5;
echo $x;
echo "&lt;br /&gt;";
echo $x+++$x++;
echo "&lt;br /&gt;";
echo $x;
echo "&lt;br /&gt;";
echo $x---$x--;
echo "&lt;br /&gt;";
echo $x;

Answer →
5
11
7
1
5
</code></pre>

<p>Here I am confused with $x+++ &amp; $x--- &amp; how its work &amp; how exactly the expression $x+++$x++ evaluated. Can anybody please explain me about this. And also why just "echo $x+++" doesn't works &amp; gives error.</p>