com php-src: Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken): NEWS Zend/tests/bug74836.phpt
| From: | Dmitry Stogov | Date: | Tue, 04 Jul 2017 04:23:46 +0000 |
| Subject: | com php-src: Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken): NEWS Zend/tests/bug74836.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98308@lists.php.net to get a copy of this message | ||
Commit: bfa24e34889ec8840bc86c5c39afcfb353d06567
Author: Dmitry Stogov <dmitry@zend.com> Tue, 4 Jul 2017 07:23:46 +0300
Parents: 02ef5d380341aa1058eba34cabe6487db29f6d30
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bfa24e34889ec8840bc86c5c39afcfb353d06567
Log:
Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken)
Bugs:
https://bugs.php.net/74836
Changed paths:
M NEWS
A Zend/tests/bug74836.phpt
Diff:
diff --git a/NEWS b/NEWS
index 26d0917..f30825c 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 0000000..7281a07
--- /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)