Php: How can I determine if a method is called statically?

From FVue
Jump to: navigation, search

Problem

Within PHP, how can I determine if a method is called statically?

Object::method();  // Static method call
$object->method();  // Direct method call

NOTE: You can't check for is_object($this), because when called static, $this points to the class (if available) in which the call was made. See also: http://bugs.php.net/bug.php?id=12622.

Journal

20060825

Zend / Mailing lists: (PHP-DEV) Static call detection

Comments

blog comments powered by Disqus