|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-18 15:33 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 02:00:01 2025 UTC |
Description: ------------ With PHP 4 you could create the object variable before the actual object was defined. This doesnt seem to be true in 5. If you move lines 2 and 3 of the code to the bottom the script oes work, but this does break backward compatibility. Reproduce code: --------------- <?php $new_obj = new new_class; $new_obj->hello (); class new_class { function hello () { echo "Hello"; } } ?> Expected result: ---------------- Hello Actual result: -------------- Fatal error: Class 'new_class' not found in /usr/local/apache2/htdocs/scripts/class_test.php on line 2