|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-12 12:37 UTC] derick@php.net
[2005-07-12 12:44 UTC] tonvandenheuvel at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
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!).