#18610 [Opn]: Name Space Issues / Reserved Words

From: Date: Tue, 13 Aug 2002 11:20:27 +0000
Subject: #18610 [Opn]: Name Space Issues / Reserved Words
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16595@lists.php.net to get a copy of this message
ID: 18610 Updated by: sander@php.net Reported By: ralph@_snarff.net Status: Open -Bug Type: Documentation problem +Bug Type: Scripting Engine problem Operating System: Linux 2.4.18 PHP Version: 4.2.2 New Comment: I think this is a bug - not sure, though. The warning only appears when calling a method from a non-instanciated object/class. <?php class foo { function foo() { echo "foo"; } } $this = "foo"; foo::foo(); // warning ?> Any Zend guru's that can clearify this? Previous Comments: ------------------------------------------------------------------------ [2002-07-27 18:45:45] ralph@_snarff.net When using a class (more spifically) something like Date/Calc.php supplied with PEAR: When I set a variable named "$this" before calling any class functions, it produces a warning. example: <? include("Date/Calc.php"); $this = "some text"; echo Date_Calc::dateNow("%Y%m%d"); ?> Output: -------- Warning: Problem with method call - please report this bug in <<FILENAME>> on line <<LINENUMBER>> 20020727 -------- As I am not familar with the Zend scripting engine, so this may be a bug in the rendering since it does produce only a warning, yet still operates. But if it is not, then documentation on the word "this" should be located in the documentation in the following places: http://www.php.net/manual/en/reserved.php#reserved.keywords and again under: http://www.php.net/manual/en/language.oop.php (where $this is actually used) Thanks, Ralph Schindler ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18610&edit=1

« previous php.bugs (#16595) next »