run code in 200+ php & hhvm versions
Bugs & Features
<?php define('A', null); class Foo { const NO_VALUE = null; public static function bar(Foo $param = A) { if ($param == self::NO_VALUE) echo "Param was NO_VALUE" else echo "Param was a valid instance of Foo"; } }
Output for 5.3.0 - 5.4.13
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/RcCmt on line 6
Process exited with code 255.