ID:               26121
 Updated by:       [EMAIL PROTECTED]
 Reported By:      closer at netnitco dot net
-Status:           Open
+Status:           Wont fix
 Bug Type:         Zend Engine 2 problem
 Operating System: Redhat Linux 9.0 / Apache 2.0.46
 PHP Version:      5.0.0b2 (beta2)
 New Comment:

This is expected and correct behaviour.



Previous Comments:
------------------------------------------------------------------------

[2003-11-04 14:16:22] closer at netnitco dot net

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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26121&edit=1

Reply via email to