PHP3 Manual | ||
---|---|---|
Prev | Appendix A. Migrating from PHP/FI 2.0 to PHP 3.0 | Next |
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:
$a[0]=5; $a[1]=7; $key = key($a); while ("" != $key) { echo "$keyn"; next($a); }
The fix for this is simple. Replace the while statement with:
while ((string)$key != "") {
Prev | Home | Next |
while syntax | Up | Error messages have changed |