From:             laruence at yahoo dot com dot cn
Operating system: linux readhat
PHP version:      5.2.6
PHP Bug Type:     Compile Failure
Bug description:  extends from a class which is extends from another case 
complie failed

Description:
------------
I found when I extends from a class which is also extended from a class
case the complie failed .

the parsing process:
starr:
    top_statement_list
;

top_statement_list:
        top_statement_list 
.... //有省略
;


top_statement:
.... //有省略
    |   class_declaration_statement   
 .... //有省略
;

class_declaration_statement:
        unticked_class_declaration_statement 
;

unticked_class_declaration_statement:
        class_entry_type T_STRING extends_from
.... //有省略
;

class_entry_type:
        T_CLASS
.... //有省略
;

extends_from:
        /* empty */   
    |   T_EXTENDS fully_qualified_class_name
.... //有省略
;
fully_qualified_class_name:
        T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); }
;

but if class with named fully_qualified_class_name is also a inherited
class , there must be some mechanism to guaranteed the
fully_qualified_class_name to be processed first...
class 

Reproduce code:
---------------
<?php
class a extends b {
};
class b extends c{
};
class c{
};
?>

Expected result:
----------------
PHP Fatal error:  Class 'b' not found in /home/xinchen/1.php on line 2
Fatal error: Class 'b' not found in /home/xinchen/1.php on line 2

Actual result:
--------------
http://www.laruence.com/2008/08/24/427.html

-- 
Edit bug report at http://bugs.php.net/?id=45903&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45903&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45903&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45903&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45903&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45903&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45903&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45903&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45903&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45903&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45903&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45903&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45903&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45903&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45903&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45903&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45903&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45903&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45903&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45903&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45903&r=mysqlcfg

Reply via email to