run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { const NO_VALUE = null; public static function bar(Foo $param = self::NO_VALUE) { 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/4HQ3N on line 5
Process exited with code 255.