是否可以在 PHP 中每当调用类中的函数时触发事件,而不将其添加到类中的每个函数中?
例子:
<?php
class A {
function xxx() {
//this function will be called everytime I call another function in this class
}
public static function b() {
return 'Hello Stackoverflow!';
}
public static function c() {
//I also want this function to trigger the event!
}
}
echo A::b();
?>