<!DOCTYPE html><html><head></head>
<body><?php
function shout($a,$b){
echo $a.$b."!<br />";
}
call_user_func('shout','Hello',' World');
call_user_func_array('shout',['Hello',' World']);
?></body></html>
<!DOCTYPE html><html><head></head>
<body><?php
function shout($a,$b){
echo $a.$b."!<br />";
}
call_user_func('shout','Hello',' World');
call_user_func_array('shout',['Hello',' World']);
?></body></html>
Hello World!
Hello World!
<!DOCTYPE html><html><head></head>
<body><?php
class P{
const NAME = 'P';
public static function test() {
$args = func_get_args();
echo static::NAME, " ".join(',', $args)." <br />";
}
}
class C extends P{
const NAME = 'C';
public static function test() {
echo self::NAME, "<br />";
forward_static_call(array('P','test'),'AB','CD');
forward_static_call('test','OP', 'QR');
forward_static_call_array( 'test',['OP', 'QR']);
}
}
C::test('foo');
function test() {
$args = func_get_args();
echo "test ".join(',', $args)." <br />";
}
?></body></html>
<!DOCTYPE html><html><head></head>
<body><?php
class P{
const NAME = 'P';
public static function test() {
$args = func_get_args();
echo static::NAME, " ".join(',', $args)." <br />";
}
}
class C extends P{
const NAME = 'C';
public static function test() {
echo self::NAME, "<br />";
forward_static_call(array('P','test'),'AB','CD');
forward_static_call('test','OP', 'QR');
forward_static_call_array( 'test',['OP', 'QR']);
}
}
C::test('foo');
function test() {
$args = func_get_args();
echo "test ".join(',', $args)." <br />";
}
?></body></html>
C
C AB,CD
test OP,QR
test OP,QR