The first line (taken from the help file) works fine.
The second one generates an error when assigning the array element.
Code: Select all
$n = 4; $a[$n+4] = $n * 4; echo $a[$n+4];
$n = 4; $a[$n+4] = $n * 4; $temp = $a[$n+4]; echo $temp;
Code: Select all
$n = 4; $a[$n+4] = $n * 4; echo $a[$n+4];
$n = 4; $a[$n+4] = $n * 4; $temp = $a[$n+4]; echo $temp;
The interpreter complains
'$temp = $a[$n+4]' is not a valid script command.