Backward Incompatible Changes

Although most existing PHP 4 code should work without changes, you should pay attention to the following backward incompatible changes:

Esempio B-1. strrpos() and strripos() now use the entire string as a needle

<?php
var_dump
(strrpos('ABCDEF','DEF')); //int(3)

var_dump(strrpos('ABCDEF','DAF')); //bool(false)
?>

Esempio B-2. An object with no properties is no longer considered "empty"

<?php
class test { }
$t = new test();

var_dump(empty($t)); // echo bool(false)

if ($t) {
    
// Will be executed
}
?>

Esempio B-3. In some cases classes must be declared before used

<?php

//works with no errors:
$a = new a();
class
a {
}


//throws an error:
$a = new b();

interface c{
}
class
b implements c {
}

?>

Hosting by: hurra.com
Generated: 2007-01-26 17:56:53