3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo{ public $var; public function set(?int $value = null){ $this->var = $value; } } $foo = new Foo(); $foo->set(null); var_dump($foo);
based on E4L2e
Output for 7.1.0 - 7.3.0rc3
object(Foo)#1 (1) { ["var"]=> NULL }
Output for 5.6.38 - 7.0.28
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /in/G9NGP on line 6
Process exited with code 255.