Andere Inkompatibilitäten
- Das PHP 3.0 Apache Modul unterstützt keine Apache Versionen mehr, die älter als 1.2 sind. Apache 1.2 oder neuer wird benötigt.
- echo() no longer supports a format string. Use the printf() function instead.
- In PHP/FI 2.0, an implementation side-effect caused $foo[0] to have the same effect as $foo. This is not TRUE for PHP 3.0.
- Das Auslesen von Arrays mit $array[] wird nicht mehr unterstützt That is, you cannot traverse an array by having a loop that does $data = $array[]. Use current() and next() instead. Also, $array1[] = $array2 does not append the values of $array2 to $array1, but appends $array2 as the last entry of $array1. See also multidimensional array support.
- "+" is no longer overloaded as a concatenation operator for strings, instead it converts it's arguments to numbers and performs numeric addition. Use "." instead.
Example#1 Migration from 2.0: concatenation for strings
echo "1" + "1";
In PHP 2.0 würde dies 11 ausgeben, in PHP 3.0 2. Verwenden Sie stattdessen:
echo "1"."1";
$a = 1;
$b = 1;
echo $a + $b;
Dies würde sowohl in PHP 2.0 als auch in 3.0 2 ausgeben.
$a = 1;
$b = 1;
echo $a.$b;