This article mainly introduces the __call and __callStatic methods of PHP magic methods. Friends in need can refer to them. I hope it can help you.
Core code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
You want to call my non-existent method t method
Also passed a parameter
Array ( [0] => 1 [1] => 2 [2] => 3 )
You want to call my non-existent method say method
Also passed a parameter
Array ( [0] => a [1] => b [2] => c )
You want to call my non-existent run static method
You also passed a parameter
Array ( [0] => d [1] => e [2] => f )
Related recommendations:
php’s magic method __get() , __set(), __call(), __callStatic() and static usage detailed explanation
Detailed explanation of the usage and difference between __call and __callStatic in php
The above is the detailed content of Detailed explanation of how to use PHP__call and __callStatic. For more information, please follow other related articles on the PHP Chinese website!