cvs: ZendEngine2(PHP_5_1) / zend_execute_API.c zend_hash.h /tests bug35509.phpt php-src NEWS

From: Date: Mon, 05 Dec 2005 08:56:11 +0000
Subject: cvs: ZendEngine2(PHP_5_1) / zend_execute_API.c zend_hash.h /tests bug35509.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4421@lists.php.net to get a copy of this message
dmitry Mon Dec 5 03:56:11 2005 EDT Added files: (Branch: PHP_5_1) /ZendEngine2/tests bug35509.phpt Modified files: /php-src NEWS /ZendEngine2 zend_execute_API.c zend_hash.h Log: Fixed bug #35509 (string constant as array key has different behavior inside object) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.272&r2=1.2027.2.273&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.272 php-src/NEWS:1.2027.2.273 --- php-src/NEWS:1.2027.2.272 Sun Dec 4 12:30:40 2005 +++ php-src/NEWS Mon Dec 5 03:55:57 2005 @@ -24,6 +24,8 @@ - Fixed bug #35543 (php crash when calling non existing method of a class that extends PDO). (Tony) - Fixed bug #35539 (typo in error message for ErrorException). (Tony) +- Fixed bug #35509 (string constant as array key has different behavior inside + object). (Dmitry) - Fixed bug #35508 (PDO fails when unknown fetch mode specified). (Tony) - Fixed bug #35499 (strtotime() does not handle whitespace around the date string). (Ilia) http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.331.2.5&r2=1.331.2.6&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.5 ZendEngine2/zend_execute_API.c:1.331.2.6 --- ZendEngine2/zend_execute_API.c:1.331.2.5 Thu Nov 24 06:33:11 2005 +++ ZendEngine2/zend_execute_API.c Mon Dec 5 03:56:09 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331.2.5 2005/11/24 11:33:11 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.6 2005/12/05 08:56:09 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -501,17 +501,9 @@ *element = new_val; switch (const_value.type) { - case IS_STRING: { - long lval; - double dval; - - if (is_numeric_string(const_value.value.str.val, const_value.value.str.len, &lval, &dval, 0) == IS_LONG) { - zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_LONG, NULL, 0, lval); - } else { - zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_STRING, const_value.value.str.val, const_value.value.str.len+1, 0); - } + case IS_STRING: + zend_symtable_update_current_key(p->value.ht, const_value.value.str.val, const_value.value.str.len+1); break; - } case IS_BOOL: case IS_LONG: zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_LONG, NULL, 0, const_value.value.lval); http://cvs.php.net/diff.php/ZendEngine2/zend_hash.h?r1=1.78&r2=1.78.2.1&ty=u Index: ZendEngine2/zend_hash.h diff -u ZendEngine2/zend_hash.h:1.78 ZendEngine2/zend_hash.h:1.78.2.1 --- ZendEngine2/zend_hash.h:1.78 Wed Aug 3 09:30:52 2005 +++ ZendEngine2/zend_hash.h Mon Dec 5 03:56:09 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.h,v 1.78 2005/08/03 13:30:52 sniper Exp $ */ +/* $Id: zend_hash.h,v 1.78.2.1 2005/12/05 08:56:09 dmitry Exp $ */ #ifndef ZEND_HASH_H #define ZEND_HASH_H @@ -353,6 +353,12 @@ return zend_hash_exists(ht, arKey, nKeyLength); } +static inline int zend_symtable_update_current_key(HashTable *ht, char *arKey, uint nKeyLength) +{ + HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx)); + return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, arKey, nKeyLength, 0); +} + #endif /* ZEND_HASH_H */ /* http://cvs.php.net/co.php/ZendEngine2/tests/bug35509.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug35509.phpt +++ ZendEngine2/tests/bug35509.phpt

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