PHP 5.3.0 oferece uma grande gama de novos recursos:
const
.
?:
.
<?php
class C {
public static $foo = 123;
}
$a = "C";
echo $a::$foo;
?>
O exemplo acima irá imprimir:
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);
}
?>