Okey, Lets start with first one. You assign the value of $a[0] as 1, you apply an increment operation on it, but store again in $a[0], The $a[0] is not update yet cause the increment is post-increment. But if you did it as pre-increment then you will get the value 2.
Ex: 1
$a[0] = 1;
$a[0] = $a[0]++;
echo $a[0]; //1
See the effect of pre-increment:
$a[0] = 1;
$a[0] = ++$a[0];
echo $a[0]; //2
Ex:2
Same as example one, you did the post-increment, this time you store in different variable that means, the $a[0] not updated here and the increment operation implement. so you got the result as 2. Here the post and pre both is same.
$a[0] = 1;
$b[0] = $a[0]++;
echo $a[0]; //2
Here the value of $b[0] will be same as the value of $a[0] at this stage. But if the pre-increment applied here then the value of $b[0] also changed and its stores 2.
Note: All you have to understand the pre-increment and
post-increment. For more visit -
language.operators.increment.php