3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function f(&$ref1, &$ref2) { $ref1 = 'foo'; $ref2 = 'bar'; } } class b { public function __call($methodName, $arguments) { $a = new a(); call_user_func_array(array( $a, $methodName //->$methodName( $arguments[0][0], $arguments[0][1]); ), $arguments[0]); } } $ref1 = 'X'; $ref2 = 'Y'; $b = new b(); $b->f( array( &$ref1, &$ref2)); var_dump($ref1, $ref2);

preferences:
90.75 ms | 402 KiB | 5 Q