What is the output of the following code?

What is the output of the following code?

class Test {

public function _call($name, $args)

{

call_user_func_array(array(‘static’, "test$name"), $args);

}

public function testS($1) {

echo "$1,";

class Test2 extends Test {

public function testS($1) {

echo "$1,$1,";

}

$test = new Test2();

$test->S(‘A’);
A . A,
B . A,A,
C . A,A,A,
D . PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback

Answer: B

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments