RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests bug42859.phpt php-src NEWS

From: Date: Thu, 18 Oct 2007 05:27:15 +0000
Subject: RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests bug42859.phpt php-src NEWS
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6096@lists.php.net to get a copy of this message
Probably you are right. :) Dmitry. > -----Original Message----- > From: Jani Taskinen [mailto:jani.taskinen@sci.fi] > Sent: Thursday, October 18, 2007 1:05 AM > To: Dmitry Stogov > Cc: zend-engine-cvs@lists.php.net > Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / > zend_compile.c /tests bug42859.phpt php-src NEWS > > > > What's the point with NEWS entries about fixing bugs in > something that has never > been in any PHP release yet? :) > > --Jani > > > Dmitry Stogov kirjoitti: > > dmitry Wed Oct 17 10:01:22 2007 UTC > > > > Added files: (Branch: PHP_5_3) > > /ZendEngine2/tests bug42859.phpt > > > > Modified files: > > /php-src NEWS > > /ZendEngine2 zend_compile.c > > Log: > > Fixed bug #42859 (import always conflicts with internal classes). > > (cellog@php.net, Dmitry) > > > > > > > > http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.26& > > r2=1.2027.2.547.2.965.2.27&diff_format=u > > Index: php-src/NEWS > > diff -u php-src/NEWS:1.2027.2.547.2.965.2.26 > php-src/NEWS:1.2027.2.547.2.965.2.27 > > --- php-src/NEWS:1.2027.2.547.2.965.2.26 Sat Oct 13 18:08:04 2007 > > +++ php-src/NEWS Wed Oct 17 10:01:21 2007 > > @@ -40,6 +40,8 @@ > > - Improved and cleaned CGI code. FastCGI is now always > enabled and can not be > > disabled. See sapi/cgi/CHANGES for more details. (Dmitry) > > > > +- Fixed bug #42859 (import always conflicts with internal classes). > > + (cellog@php.net, Dmitry) > > - Fixed bug #42820 (defined() on constant with namespace > prefixes tries to load > > class). (Dmitry) > > - Fixed bug #42798 (__autoload() not triggered for classes used in > > method > > > http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1. 647.2.27.2.41.2.9&r2=1.647.2.27.2.41.2.10&diff_format=u > > Index: ZendEngine2/zend_compile.c > > diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.9 > ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.10 > > --- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.9 Sun Oct > 7 05:22:02 2007 > > +++ ZendEngine2/zend_compile.c Wed Oct 17 10:01:21 2007 > > @@ -17,7 +17,7 @@ > > > > > +------------------------------------------------------------- > ---------+ > > */ > > > > -/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.9 2007/10/07 05:22:02 > > davidw Exp $ */ > > +/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.10 2007/10/17 10:01:21 > > +dmitry Exp $ */ > > > > #include <zend_language_parser.h> > > #include "zend.h" > > @@ -4632,7 +4632,19 @@ > > zend_error(E_COMPILE_ERROR, "Cannot use '%s' as > import name", Z_STRVAL_P(name)); > > } > > > > - if (zend_hash_exists(CG(class_table), lcname, > Z_STRLEN_P(name)+1)) { > > + if (CG(current_namespace)) { > > + /* Prefix import name with current namespace > name to avoid conflicts with classes */ > > + char *ns_name = > emalloc(Z_STRLEN_P(CG(current_namespace)) + 2 + > > +Z_STRLEN_P(name) + 1); > > + > > + zend_str_tolower_copy(ns_name, > Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); > > + ns_name[Z_STRLEN_P(CG(current_namespace))] = ':'; > > + ns_name[Z_STRLEN_P(CG(current_namespace))+1] = ':'; > > + > memcpy(ns_name+Z_STRLEN_P(CG(current_namespace))+2, lcname, > Z_STRLEN_P(name)+1); > > + if (zend_hash_exists(CG(class_table), ns_name, > Z_STRLEN_P(CG(current_namespace)) + 2 + Z_STRLEN_P(name)+1)) { > > + zend_error(E_COMPILE_ERROR, "Import > name '%s' conflicts with defined class", Z_STRVAL_P(name)); > > + } > > + efree(ns_name); > > + } else if (zend_hash_exists(CG(class_table), lcname, > > +Z_STRLEN_P(name)+1)) { > > zend_error(E_COMPILE_ERROR, "Import name '%s' > conflicts with defined class", Z_STRVAL_P(name)); > > } > > > > > > > > http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug42859.phpt?view=mar > > kup&rev=1.1 > > Index: ZendEngine2/tests/bug42859.phpt > > +++ ZendEngine2/tests/bug42859.phpt > > > > -- > Zend Engine CVS Mailing List (http://cvs.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.zend-engine.cvs (#6096) next »