ID:               33657
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tonvandenheuvel at gmail dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      4.4.0
 New Comment:

You should never have to test if a function is static or not - if you
have to your design is broken.


Previous Comments:
------------------------------------------------------------------------

[2005-07-12 12:17:56] tonvandenheuvel at gmail dot com

Description:
------------
Currently, I'm using this function to determine whether a function is
called statically:

function IsCalledStatically() {
    $debugBt = debug_backtrace();

    return $debugBt[1]['type'] == '::';
}

Having to rely on the debugger is not very efficient here. Other
methods checking whether $this is set are not fool proof in a situation
where a class' method is called statically from another class method
where $this is defined (possibly within the same class!).



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33657&edit=1

Reply via email to