Mantis - Quercus
Viewing Issue Advanced Details
1100 major always 05-11-06 22:55 05-15-06 15:30
koreth  
ferg  
normal  
closed 3.0.19  
fixed  
none    
none 3.0.20  
0001100: Division or modulo expressions don't work as array indexes
PHP file:

<?php
$foo[0] = "a";
$foo[1] = "b";
$foo[2] = "c";

print "constant [" . $foo[2] . "]
";
print "add [" . $foo[1 + 1] . "]
";
print "subtract [" . $foo[3 - 1] . "]
";
print "multiply [" . $foo[2 * 1] . "]
";
print "divide [" . $foo[2 / 1] . "]
";
print "modulo [" . $foo[5 % 3] . "]
";
print "modulo as string [" . $foo["" . (5 % 3)] . "]
";
?>

This should print "c" on all the lines, but it doesn't:

constant [c]
add [c]
subtract [c]
multiply [c]
divide []
modulo []
modulo as string [c]

Notes
(0001131)
ferg   
05-15-06 15:30   
php/0422, php/3422