ID: 30741 Updated by: [EMAIL PROTECTED] Reported By: chris at experiencetours dot com dot au Status: Open -Bug Type: Class/Object related +Bug Type: Documentation problem Operating System: Linux PHP Version: 5.0.2 New Comment:
This is expected behavior, but should be mentioned in PHP 5's migration guide (http://de.php.net/manual/en/migration5.oop.php) Previous Comments: ------------------------------------------------------------------------ [2004-11-10 01:43:26] chris at experiencetours dot com dot au Description: ------------ I am not sure if this is a bug or a documentation issue, but if an instance of a class is created before the Interface definition, the class will be undefined. Although this is not directly covered in the manual, it is inconsistent with functions, which can be reference before they are defined. ./configure --with-apache=/usr/local/src/apache/apache_1.3.31 --with-libxml-dir=/usr/local/libxml2 --enable-calendar --with-openssl=/usr --wi th-pear --with-zlib --enable-ftp --with-bz2 --with-ldap --with-pdflib --without-mysql --with-pgsql --with-pspell Reproduce code: --------------- $concreteType = new ConcreteType(); echo $concreteType->getText(); $c2 = new ContreteType2(); echo $c2->getText(); interface IType { public function getText(); } abstract class AbstractType implements IType { } class ConcreteType extends AbstractType { public function getText() { return "Hello World!!!"; } } class ConcreteType2 implements IType { public function getText() { return "Hello World!!!"; } } Expected result: ---------------- "Hello World!!!""Hello World!!!" Actual result: -------------- Fatal error: Class 'ConcreteType' not found in /usr/local/apache/htdocs/bookallot/test.php on line 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30741&edit=1
