php-src/Zend/tests/bug77589.phpt
Xinchen Hui 6295ff77b7 Fixed bug #79244 (php crashes during parsing INI file). (Laruence)
Cherry-picked the fix(not sure why this wasn't merged to 7.4) for:
Fixed bug #77589 (Core dump using parse_ini_string with numeric sections)

Section name should not be typed(NULL, FALSE, TRUE etc)

Conflicts:

	Zend/zend_ini_scanner.c
2020-02-10 13:01:51 +08:00

41 lines
455 B
PHP

--TEST--
BUG #77589 (Core dump using parse_ini_string with numeric sections)
--FILE--
<?php
var_dump(
parse_ini_string(<<<INI
[0]
a = 1
b = on
c = true
["true"]
a = 100
b = null
c = yes
INI
, TRUE, INI_SCANNER_TYPED));
?>
--EXPECT--
array(2) {
[0]=>
array(3) {
["a"]=>
int(1)
["b"]=>
bool(true)
["c"]=>
bool(true)
}
["true"]=>
array(3) {
["a"]=>
int(100)
["b"]=>
NULL
["c"]=>
bool(true)
}
}