#20242 [Opn]: Method call infront of class definition

From: Date: Mon, 04 Nov 2002 12:45:45 +0000
Subject: #20242 [Opn]: Method call infront of class definition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-24036@lists.php.net to get a copy of this message
ID: 20242 User updated by: marcus.boerger@post.rwth-aachen.de Reported By: marcus.boerger@post.rwth-aachen.de Status: Open Bug Type: Scripting Engine problem PHP Version: 4CVS-2002-11-04 New Comment: Ups i rechecked it and now it works for ZE 1.3 maybe i missconfigured the test for ZE1. But it still fails for ZE2. I guess i should commit the test then. Previous Comments: ------------------------------------------------------------------------ [2002-11-04 06:25:39] moriyoshi@php.net Huh? It just works for me. Hmm I'm rather interested in what causes it to fail in your environment. ------------------------------------------------------------------------ [2002-11-04 05:17:21] marcus.boerger@post.rwth-aachen.de While you can call functions in front or after current code you cannot do so with classes. As this is documented nowhere this is an error with both ZE1 and ZE2. Following .phpt file: ==================================== --TEST-- Method call infront of class definition --FILE-- <?php test::show_static(); $t = new test; $t->show_method(); class test { function show_static() { echo "static\n"; } function show_method() { echo "method\n"; } } ?> --EXPECT-- static method =EOF================================ Produces following .out ==================================== <font color=ff0000> Fatal error: Class 'test' not found in /usr/src/php4-HEAD/tests/classes/classes001.php on line 3 </font>/usr/src/php4-HEAD/tests/classes/classes001.php(3) : Fatal error - Class 'test' not found =EOF================================ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20242&edit=1

« previous php.bugs (#24036) next »