PHP 5.3.0 offers a wide range of new features:
<?php
class C {
public static $foo = 123;
}
$a = "C";
echo $a::$foo;
?>
Powyższy przykład wyświetli:
123
<?php
class MyCustomException extends Exception {}
try {
throw new MyCustomException("Exceptional", 112);
} catch (Exception $e) {
/* Note the use of the third parameter to pass $e
* into the RuntimeException. */
throw new RuntimeException("Rethrowing", 911, $e);
}
?>