PHP/FI 2.0 used the left side of expressions to determine what type the result should be. PHP 3.0 takes both sides into account when determining result types, and this may cause 2.0 scripts to behave unexpectedly in 3.0.
Consider this example:
1 2 $a[0]=5; 3 $a[1]=7; 4 5 $key = key($a); 6 while ("" != $key) { 7 echo "$keyn"; 8 next($a); 9 } 10 |
The fix for this is simple. Replace the while statement with:
1 2 while ((string)$key != "") { 3 |