xref: /PHP-8.2/Zend/tests/zend_ini/gh11876.phpt (revision d229a480)
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--EXPECTF--
23Warning: Invalid quantity "0x0x12": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
24int(0)
25
26Warning: Invalid quantity "0b+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
27int(0)
28
29Warning: Invalid quantity "0o+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
30int(0)
31
32Warning: Invalid quantity "0x+10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
33int(0)
34
35Warning: Invalid quantity "0b 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
36int(0)
37
38Warning: Invalid quantity "0o 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
39int(0)
40
41Warning: Invalid quantity "0x 10": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
42int(0)
43
44Warning: Invalid quantity "0g10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
45int(0)
46
47Warning: Invalid quantity "0m10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
48int(0)
49
50Warning: Invalid quantity "0k10": unknown multiplier "0", interpreting as "0" for backwards compatibility in %s on line %d
51int(0)
52