]> granicus.if.org Git - php/commitdiff
Fixed bug #69125 (Array numeric string as key)
authorXinchen Hui <laruence@php.net>
Fri, 27 Feb 2015 03:42:36 +0000 (11:42 +0800)
committerXinchen Hui <laruence@php.net>
Fri, 27 Feb 2015 03:42:36 +0000 (11:42 +0800)
NEWS
ext/opcache/Optimizer/zend_optimizer.c
ext/opcache/tests/bug69125.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index f8d653fd5b2479cbcada0521b963fd4d55157086..a020e6954b447d6461f2ef38d961b2cbcb33e9a9 100644 (file)
--- 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:
index ca5d41d8d50fb39ec4927e520ef56957f1ddfd2e..be49b4956bd6cd3a53c46677ae6a6b2accb4bea1 100644 (file)
@@ -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 (file)
index 0000000..913be01
--- /dev/null
@@ -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"