summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-07-04 07:23:46 +0300
committerDmitry Stogov <dmitry@zend.com>2017-07-04 07:23:46 +0300
commitbfa24e34889ec8840bc86c5c39afcfb353d06567 (patch)
tree6e7f0a231c8cb49c84ad6abb1deedc712029f1bb
parent02ef5d380341aa1058eba34cabe6487db29f6d30 (diff)
downloadphp-git-bfa24e34889ec8840bc86c5c39afcfb353d06567.tar.gz
Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken)
-rw-r--r--NEWS2
-rw-r--r--Zend/tests/bug74836.phpt33
2 files changed, 35 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 26d09174b9..f30825c982 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP NEWS
. Added object type annotation. (brzuchal)
. Fixed bug #74815 (crash with a combination of INI entries at startup).
(Anatol)
+ . Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken).
+ (Dmitry)
- CLI:
. Fixed bug #74849 (Process is started as interactive shell in PhpStorm).
diff --git a/Zend/tests/bug74836.phpt b/Zend/tests/bug74836.phpt
new file mode 100644
index 0000000000..7281a07e0e
--- /dev/null
+++ b/Zend/tests/bug74836.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #74836 (isset on zero-prefixed numeric indexes in array broken)
+--FILE--
+<?php
+$s = "1234567890a";
+$a[10] = "42";
+$i = "010";
+
+var_dump($s["10"], isset($s["10"]));
+var_dump($s["010"], isset($s["010"]));
+var_dump($s[$i], isset($s[$i]));
+
+var_dump($a["10"], isset($a["10"]));
+var_dump($a["010"], isset($a["010"]));
+var_dump($a[$i], isset($a[$i]));
+?>
+--EXPECTF--
+string(1) "a"
+bool(true)
+string(1) "a"
+bool(true)
+string(1) "a"
+bool(true)
+string(2) "42"
+bool(true)
+
+Notice: Undefined index: 010 in %s on line %d
+NULL
+bool(false)
+
+Notice: Undefined index: 010 in %s on line %d
+NULL
+bool(false)