3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Everything you enter here will be executed by our servers. Try it! class A { public $b; public function A(B $b = null){ if(is_null($b) $b = new B(); $this->b = $b; } } class B { public $a; public function B(A $a = null) { if(is_null($a)) $a = new A(); $this->a = $a; } } var_dump(new A(new B(new A())));
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$b' (T_VARIABLE) in /in/qUTaV on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/qUTaV on line 8
Process exited with code 255.