test(compiler): add test case for nested unset with numeric string keys

- Create test for nested unset behavior with numeric string keys in empty array
- Verify proper removal of numeric string keys when using unset operation
- Confirm expected array structure after unset operations
- Document issue #114 related to numeric string key handling
master
韩天峰 3 weeks ago
parent ec2ac9e253
commit 2c4596c566
  1. 34
      tests/compiler/basic/unset-numeric-string-key.phpt

@ -0,0 +1,34 @@
--TEST--
Nested unset removes numeric string keys created in an empty array (#114)
--FILE--
<?php
function main(): void {
$a = [];
$a['1']['1'] = '1';
$a['1']['2'] = '2';
$a['1']['3'] = '3';
var_dump($a);
unset($a['1']['1']);
unset($a['1']['2']);
var_dump($a);
}
?>
--EXPECT--
array(1) {
[1]=>
array(3) {
[1]=>
string(1) "1"
[2]=>
string(1) "2"
[3]=>
string(1) "3"
}
}
array(1) {
[1]=>
array(1) {
[3]=>
string(1) "3"
}
}
Loading…
Cancel
Save