3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class C { public function __construct() [ $this->b = new B($this); } public function __destruct() { echo 'c destructing!'; } } class B { public function __construct($C){ $this->c = $c; } public function __destruct() { echo 'b destructing!'; } } $c = new C; die();
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '[', expecting ';' or '{' in /in/NtbkX on line 3
Process exited with code 255.