|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-14 09:39 UTC] degeberg@php.net
-Status: Open
+Status: Wont fix
[2010-04-14 09:39 UTC] degeberg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ If a call a method as static, how I can test if is a static call or objective? Well, I think about "is_static_call()", example: class A { public function test(){ if(is_static_call()){ echo 'Static method'; } else { echo 'Objective method'; } } } A::test(); // Static method $a = new A; $a->test(); // Objective method Currently I use a 'workarround' for this problem: if($this && get_class($this) === get_class()){ // Objective method } This is my sugestion. Bye.