#29703 [Opn->Csd]: Function to determine if a method is called statically
| From: | tip at tut dot by | Date: | Mon, 16 Aug 2004 10:32:21 +0000 |
| Subject: | #29703 [Opn->Csd]: Function to determine if a method is called statically | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64698@lists.php.net to get a copy of this message | ||
ID: 29703
User updated by: tip at tut dot by
Reported By: tip at tut dot by
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
PHP Version: 4.3.9RC1
New Comment:
Sorry. Found a bug in my own sources. =\
It was unhandled echo call few lines above
echo
print_r(isset($this));
Previous Comments:
------------------------------------------------------------------------
[2004-08-16 12:32:18] tip at tut dot by
Sorry. Found a bug in my own sources. =\
It was unhandled echo call few lines above
echo
print_r(isset($this));
------------------------------------------------------------------------
[2004-08-16 12:16:11] tip at tut dot by
Description:
------------
Sometimes it is very convenient to use method from a class statically,
but while implementing such a function there's no way to determine how
this function is used.
executing this line from a static method call returns 1
print_r(isset($this));
while operations with is_object($this), gettype($this) etc. results in
PHP Notice: Undefined variable: this in
c:\httpd\.php\pear\File\Find.php on line 198
Reproduce code:
---------------
// executed from static method call
print_r(isset($this));
Expected result:
----------------
FALSE
Actual result:
--------------
1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29703&edit=1