& Amp; lt ;? Phpfunctiona ($ args) {echo $ args;} functionb ($ args) {return $ args;} a (B (6666 )); output 6666 ************************ functionc ($ callback) {echo $ callback (3 );} functiond ($ args) {return... Function a ($ args ){
Echo $ args;
}
Function B ($ args ){
Return $ args;
}
A (B (6666)); // Output 6666
//************************
Function c ($ callback ){
Echo$ Callback (3);
}
Function d ($ args ){
Return $ args;
}
C ('D'); // Output 3
Both examples can run normally, that is, the callback function parameters can bePass the function directly.Why do I still need to passVariable FunctionsIs it true that
Reply content:
Function a ($ args ){
Echo $ args;
}
Function B ($ args ){
Return $ args;
}
A (B (6666)); // Output 6666
//************************
Function c ($ callback ){
Echo$ Callback (3);
}
Function d ($ args ){
Return $ args;
}
C ('D'); // Output 3
Both examples can run normally, that is, the callback function parameters can bePass the function directly.Why do I still need to passVariable FunctionsIs it true that
In this example, the function name is passed, not the function.
Your example is an example of the variable function mentioned in the book.