PrepAway - Latest Free Exam Questions & Answers

How should class MyObject be defined for the following code to work properly?

How should class MyObject be defined for the following code to work properly? Assume
$array is an array and MyObject is a user-defined class. $obj = new MyObject();
array_walk($array, $obj);

PrepAway - Latest Free Exam Questions & Answers

A.
MyObject should extend class Closure

B.
MyObject should implement interface Callable

C.
MyObject should implement method __call

D.
MyObject should implement method __invoke

Explanation:


Leave a Reply

Your email address will not be published. Required fields are marked *