3v4l.org

run code in 200+ PHP versions simultaneously
<?php function ref(&$ref) { var_dump($ref); } class a { function __construct() { $args = array(&$this); for ($i = 0; $i < 2; $i++) { $a = array_slice($args, 0, 1); call_user_func_array('ref', $a); } } }; new a();
Output for 7.1.0 - 7.2.6
Warning: Parameter 1 to ref() expected to be a reference, value given in /in/MCmnj on line 12 object(a)#1 (0) { } Warning: Parameter 1 to ref() expected to be a reference, value given in /in/MCmnj on line 12 object(a)#1 (0) { }
Output for 5.0.0 - 7.0.20
object(a)#1 (0) { } object(a)#1 (0) { }
Output for 4.3.0 - 4.4.9