--TEST-- Test with optimization of function calls --INI-- opcache.enable=1 opcache.enable_cli=1 opcache.optimization_level=-1 --SKIPIF-- --FILE-- obj); $obj = new A; ref($obj->obj); var_dump($obj->obj); ref(retarray()[0]); $a = "a"; foo(a($a), $a, ref($b, $c), $obj); var_dump($a); var_dump($b); /* * INIT_FCALL_BY_NAME * SEND_VAL * DO_FCALL_BY_NAME */ ref("xxx"); function retarray() { return array("retarray"); } function foo($a) { print_r(func_get_args()); } function ref(&$b) { $b = "changed"; return "ref"; } --EXPECTF-- Array ( [0] => done ) string(7) "changed" Array ( [0] => done ) string(7) "changed" Array ( [0] => A Object ( [obj] => ) ) Array ( [0] => ) string(7) "changed" Array ( [0] => done [1] => changed [2] => ref [3] => A Object ( [obj] => changed ) ) string(7) "changed" string(7) "changed" Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %soptimize_func_calls.php:%d Stack trace: #0 {main} thrown in %soptimize_func_calls.php on line %d