Warning to simultaneous positioning and assignment:
<?
$list = [ 1, 11, 21, 31 ];
var_dump($list);
// result : [ 1, 11, 21, 31 ];
$list = [ 1, 11, 21, 31 ];
$idx = 2;
$list[$idx] = -- $list[-- $idx];
var_dump($list);
// result : [ 1, 10, 21, 31 ];
$list = [ 1, 11, 21, 31 ];
$idx = 2;
$list[$idx] = -- $list[$idx --];
var_dump($list);
// result : [ 1, 20, 20, 31 ];
$list = [ 1, 11, 21, 31 ];
$idx = 2;
$list[$idx] = $list[$idx --] --;
var_dump($list);
// result : [ 1, 21, 20, 31 ];
$list = [ 1, 11, 21, 31 ];
$idx = 2;
$list[$idx] = $list[-- $idx] --;
var_dump($list);
// result : [ 1, 11, 21, 31 ];
?>
The first case shift to 11, decrement it, and redundantly assign it to itself.
Result: one single decrement.
The second case remains on the 21, decrement it, and overwrite the 11.
Result: one single decrement for two targets
The third case remains on the 21, return it, then shift to 11 and overwrite it, finally decrementing the 21.
Result: an inversion + a decrementation
The last case shift to to 11, return it for the final assignment, decrement it to 10, and then reassign it to 11.
Result: null.