cvs: ZendEngine2(PHP_5_0) / zend_API.c /tests bug30702.phpt php-src NEWS

From: Date: Tue, 26 Apr 2005 09:27:08 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_API.c /tests bug30702.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3590@lists.php.net to get a copy of this message
dmitry Tue Apr 26 05:27:08 2005 EDT Added files: (Branch: PHP_5_0) /ZendEngine2/tests bug30702.phpt Modified files: /php-src NEWS /ZendEngine2 zend_API.c Log: Fixed bug #30702 (cannot initialize class variable from class constant) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.348&r2=1.1760.2.349&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.348 php-src/NEWS:1.1760.2.349 --- php-src/NEWS:1.1760.2.348 Mon Apr 25 19:48:31 2005 +++ php-src/NEWS Tue Apr 26 05:27:04 2005 @@ -52,6 +52,8 @@ - Fixed bug #31363 (broken non-blocking flock()). ian at snork dot net - Fixed bug #30833 (array_count_values() modifying input array). (Tony) - Fixed bug #30819 (Better support for LDAP SASL bind). (Jani) +- Fixed bug #30702 (cannot initialize class variable from class constant). + (Dmitry) - Fixed bug #29944 (Function defined in switch, crashes). (Dmitry) - Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez) - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.256.2.11&r2=1.256.2.12&ty=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.256.2.11 ZendEngine2/zend_API.c:1.256.2.12 --- ZendEngine2/zend_API.c:1.256.2.11 Thu Mar 31 10:44:52 2005 +++ ZendEngine2/zend_API.c Tue Apr 26 05:27:07 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.256.2.11 2005/03/31 15:44:52 derick Exp $ */ +/* $Id: zend_API.c,v 1.256.2.12 2005/04/26 09:27:07 dmitry Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -690,8 +690,13 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) { if (!class_type->constants_updated) { + zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry); + zend_class_entry *old_scope = *scope; + + *scope = class_type; zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + *scope = old_scope; class_type->constants_updated = 1; } } http://cvs.php.net/co.php/ZendEngine2/tests/bug30702.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug30702.phpt +++ ZendEngine2/tests/bug30702.phpt

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