Although most existing PHP 5 code should work without changes, you should pay attention to the following backward incompatible changes:
NULL
when passed
incompatible arguments as of PHP 5.2.1.
TRUE
on success as of PHP 5.2.1.
TRUE
on success as of PHP 5.2.1.
FALSE
.
As of PHP 5.2.0, this operation will emit an E_WARNING
,
as is the case in all other instances where division by zero is performed.
<?php
print 10 % 0;
/* Warning: Division by zero in filename on line n */
?>
<?php
class foo {}
$foo = new foo;
print $foo;
/* Catchable fatal error: Object of class foo could
not be converted to string in filename on line n */
?>
<?php
class foo {
public function __toString() {
throw new Exception;
}
}
try {
print new foo;
/* Fatal error: Method foo::__toString() must
not throw an exception in filename on line n */
} catch(Exception $e) {}
?>
<?php
abstract class foo {
abstract static function bar();
/* Strict Standards: Static function foo::bar()
should not be abstract in filename on line n */
}
?>
data:
stream) support.
The introduction of the 'data' URL scheme has the potential to lead to a
change of behavior under Windows. If you are working with a NTFS
file system and making use of meta streams in your application, and if you
just happen to be using a file with the name 'data:' that is accessed without
any path information - it won't work any more. The fix is to use the 'file:'
protocol when accessing it.
See also » RFC 2397
<?php
/* when allow_url_include is OFF (default) */
include "data:;base64,PD9waHAgcGhwaW5mbygpOz8+";
/* Warning: include(): URL file-access is disabled
in the server configuration in filename on line n */
?>
glob()
patterns
In version 5.2.4 a security fix caused a regression for patterns of
the form "/foo/*/bar/*". Since version 5.2.5 instead of raising a warning the
glob()
function will return FALSE
when
openbase_dir
restrictions are violated.