3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $b = false; function __construct($oB) { $this->b = $oB; } } class B { public $a = false; function __construct($oA) { $this->a = $oA; } } $aDepends = array( ); $aDepends['A']=null; $oB = new B(&$aDepends['A']); $oA = new A($oB); $aDepends['A']=$oA; var_dump($oA); var_dump($oB);
based on VADEl
Output for 7.0.0
Parse error: syntax error, unexpected '&' in /in/MfqqD on line 21
Process exited with code 255.
Output for 5.4.10 - 5.6.16
Fatal error: Call-time pass-by-reference has been removed in /in/MfqqD on line 21
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/MfqqD on line 21 object(A)#2 (1) { ["b"]=> object(B)#1 (1) { ["a"]=> NULL } } object(B)#1 (1) { ["a"]=> NULL }