xref: /PHP-8.0/Zend/tests/bug74836.phpt (revision c48b745f)
1--TEST--
2Bug #74836 (isset on zero-prefixed numeric indexes in array broken)
3--FILE--
4<?php
5$s = "1234567890a";
6$a[10] = "42";
7$i = "010";
8
9var_dump($s["10"], isset($s["10"]));
10var_dump($s["010"], isset($s["010"]));
11var_dump($s[$i], isset($s[$i]));
12
13var_dump($a["10"], isset($a["10"]));
14var_dump($a["010"], isset($a["010"]));
15var_dump($a[$i], isset($a[$i]));
16?>
17--EXPECTF--
18string(1) "a"
19bool(true)
20string(1) "a"
21bool(true)
22string(1) "a"
23bool(true)
24string(2) "42"
25bool(true)
26
27Warning: Undefined array key "010" in %s on line %d
28NULL
29bool(false)
30
31Warning: Undefined array key "010" in %s on line %d
32NULL
33bool(false)
34