#30452 [Asn->WFx]: php parser does not work properly (1)
| From: | dmitry@php.net | Date: | Tue, 09 Aug 2005 11:55:40 +0000 |
| Subject: | #30452 [Asn->WFx]: php parser does not work properly (1) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83235@lists.php.net to get a copy of this message | ||
ID: 30452
Updated by: dmitry@php.net
Reported By: guth at fiifo dot u-psud dot fr
-Status: Assigned
+Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2005-06-19
Assigned To: dmitry
New Comment:
Interfaces and classes should be defined before they are used. PHP4
supported later declaration with classes, and PHP5 supports it for
backward compatibility, but we don't plan support for all compinations.
Previous Comments:
------------------------------------------------------------------------
[2005-06-24 10:56:44] gopalv82 at yahoo dot com
This looks like a bug with the runtime inheritance code-gen rather than
a parser bug.
The opcode dump I imagine looks something like
FETCH_CLASS "MyAbstractClass"
DECLARE_INHERITED_CLASS "MyClass"
DECLARE_CLASS "MyAbstractClass"
FETCH_CLASS "MyInterface"
ADD_INTERFACE
Linear opcode generation is just not possible (conditional classes !!
?)
------------------------------------------------------------------------
[2005-06-19 14:47:19] sniper@php.net
See also bug #30453
------------------------------------------------------------------------
[2005-05-09 11:31:34] sniper@php.net
Andi, (or Dmitry maybe?) can you look into this?
------------------------------------------------------------------------
[2004-10-16 01:56:33] guth at fiifo dot u-psud dot fr
Description:
------------
The following behaviour seems incorrect.
PHP founds the abstract class if it doesn't implement an interface, but
doen't found it if it implements an interface.
Reproduce code:
---------------
<?php
interface MyInterface { }
class MyClass extends MyAbstractClass { }
abstract class MyAbstractClass implements MyInterface { }
?>
<?php
interface MyInterface { }
class MyClass extends MyAbstractClass implements MyInterface { }
abstract class MyAbstractClass { }
?>
Expected result:
----------------
First :
- Should work
Second :
- Should work
Actual result:
--------------
First :
Fatal error: Class 'MyAbstractClass' not found in /www/test.php on line
5
Second :
- Work
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30452&edit=1