3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! class A { public $b; public function A(){ $this->b = new B(); } } class B { public $a; public function B() { $this->a = new A(); } } var_dump(new A());

preferences:
47.06 ms | 402 KiB | 5 Q