xref: /php-src/Zend/tests/zend_ini/gh11876.phpt (revision f39b5c4c)
1--TEST--
2Invalid INI quantities, base prefix followed by stuff eaten by strtoull()
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7
8var_dump(zend_test_zend_ini_parse_quantity('0x0x12'));
9
10var_dump(zend_test_zend_ini_parse_quantity('0b+10'));
11var_dump(zend_test_zend_ini_parse_quantity('0o+10'));
12var_dump(zend_test_zend_ini_parse_quantity('0x+10'));
13
14var_dump(zend_test_zend_ini_parse_quantity('0b 10'));
15var_dump(zend_test_zend_ini_parse_quantity('0o 10'));
16var_dump(zend_test_zend_ini_parse_quantity('0x 10'));
17
18var_dump(zend_test_zend_ini_parse_quantity('0g10'));
19var_dump(zend_test_zend_ini_parse_quantity('0m10'));
20var_dump(zend_test_zend_ini_parse_quantity('0k10'));
21
22?>
23--EXPECTF--
24Warning: Invalid quantity "0x0x12": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
25int(0)
26
27Warning: Invalid quantity "0b+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
28int(0)
29
30Warning: Invalid quantity "0o+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
31int(0)
32
33Warning: Invalid quantity "0x+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
34int(0)
35
36Warning: Invalid quantity "0b 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
37int(0)
38
39Warning: Invalid quantity "0o 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
40int(0)
41
42Warning: Invalid quantity "0x 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
43int(0)
44
45Warning: Invalid quantity "0g10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
46int(0)
47
48Warning: Invalid quantity "0m10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
49int(0)
50
51Warning: Invalid quantity "0k10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
52int(0)
53