3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Accepting NULL value */ function test(stdClass $obj = 1) { var_dump($obj); } test(new stdClass); ?>
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/f7lUg on line 4
Process exited with code 255.

preferences:
187.46 ms | 1395 KiB | 55 Q