<?php
class tests{
public function __call($m, $args)
{
//$m = test
call_user_func_array($m,$args);
}
// test..
public function test(&$a){
$a = $a + 1000;
}
}
// run.
function test(&$a){
$a PP;
}
$cls = new tests();
$a = 100;
$cls->test($a);
//test($a); // 101
echo ($a);
?>
1: call_user_func_array calls its own methods first? No need to add class objects?
2: after removing the class test method, let it call the test function. Errors will be reported.
Warning: Parameter 1 to test () expected to be a reference, value given i
excuse me, how can I get it to call the reference function?