Parameters

Return Values

User Contributed Notes 2 notes

i think that Observer pattern is always implemented as "static" to be called from any scope, for example:<?phpclass Observer {//attach here the caller's scopeprivate static $stackTrace = array( ); public static function wasTriggeredOnce() {//...if is not in the stack, then:self::$stackTrace[] = max( debug_backtrace( ) ); }}