com php-src: Fixed bug #69125 (Array numeric string as key): NEWS ext/opcache/Optimizer/zend_optimizer.c ext/opcache/tests/ bug69125.phpt
| From: | Xinchen Hui | Date: | Fri, 27 Feb 2015 03:42:36 +0000 |
| Subject: | com php-src: Fixed bug #69125 (Array numeric string as key): NEWS ext/opcache/Optimizer/zend_optimizer.c ext/opcache/tests/ bug69125.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85103@lists.php.net to get a copy of this message | ||
Commit: 3e82816ba1a82843a352ce4050b2010fd9932dee
Author: Xinchen Hui <laruence@php.net> Fri, 27 Feb 2015 11:42:36 +0800
Parents: e441d71baae89bdc5dc6f75407b4a8f5e42b8fa9
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3e82816ba1a82843a352ce4050b2010fd9932dee
Log:
Fixed bug #69125 (Array numeric string as key)
Bugs:
https://bugs.php.net/69125
Changed paths:
M NEWS
M ext/opcache/Optimizer/zend_optimizer.c
A ext/opcache/tests/bug69125.phpt
Diff:
diff --git a/NEWS b/NEWS
index f8d653f..a020e69 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ PHP NEWS
. Fixed bug #68964 (Allowed memory size exhausted with odbc_exec). (Anatol)
- Opcache:
+ . Fixed bug #69125 (Array numeric string as key). (Laruence)
. Fixed bug #69038 (switch(SOMECONSTANT) misbehaves). (Laruence)
- OpenSSL:
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index ca5d41d..be49b49 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -241,6 +241,7 @@ static void update_op2_const(zend_op_array *op_array,
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_ADD_ARRAY_ELEMENT:
case ZEND_INIT_ARRAY:
+ case ZEND_ASSIGN_DIM:
case ZEND_UNSET_DIM:
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_DIM_W:
diff --git a/ext/opcache/tests/bug69125.phpt b/ext/opcache/tests/bug69125.phpt
new file mode 100644
index 0000000..913be01
--- /dev/null
+++ b/ext/opcache/tests/bug69125.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #69125 (Array numeric string as key)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+const SZERO = '0';
+const SONE = '1';
+
+$array[SZERO] = "okey";
+$array[1] = "okey";
+
+var_dump($array[SZERO]);
+var_dump($array[SONE]);
+?>
+--EXPECT--
+string(4) "okey"
+string(4) "okey"