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 = false; //$pLink = &$aDepends; $oB = new B(false); $oA = new A($oB); //$aDepends=$oA; $oB->a = $oA; var_dump($oA); var_dump($oB);
based on M8iqF
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in /in/v4Feq:19 Stack trace: #0 {main} thrown in /in/v4Feq on line 19
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Cannot pass parameter 1 by reference in /in/v4Feq on line 19
Process exited with code 255.