3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); class Foo {}; function takesFoo(Foo $foo = null) { var_dump($foo); } takesFoo(new Foo); takesFoo(); takesFoo(null);
Output for 7.0.0 - 7.2.0
object(Foo)#1 (0) { } NULL NULL
Output for 5.3.21 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/X7Cge on line 3 object(Foo)#1 (0) { } NULL NULL