xref: /PHP-8.4/Zend/tests/zend_ini/gh16886.phpt (revision 2c267722)
1--TEST--
2GH-16886 (ini_parse_quantity() fails to emit warning for 0x+0)
3--FILE--
4<?php
5echo ini_parse_quantity('0x 0'), "\n";
6echo ini_parse_quantity('0x+0'), "\n";
7echo ini_parse_quantity('0x-0'), "\n";
8echo ini_parse_quantity('0b 0'), "\n";
9echo ini_parse_quantity('0b+0'), "\n";
10echo ini_parse_quantity('0b-0'), "\n";
11echo ini_parse_quantity('0o 0'), "\n";
12echo ini_parse_quantity('0o+0'), "\n";
13echo ini_parse_quantity('0o-0'), "\n";
14?>
15--EXPECTF--
16Warning: Invalid quantity "0x 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
170
18
19Warning: Invalid quantity "0x+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
200
21
22Warning: Invalid quantity "0x-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
230
24
25Warning: Invalid quantity "0b 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
260
27
28Warning: Invalid quantity "0b+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
290
30
31Warning: Invalid quantity "0b-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
320
33
34Warning: Invalid quantity "0o 0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
350
36
37Warning: Invalid quantity "0o+0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
380
39
40Warning: Invalid quantity "0o-0": no digits after base prefix, interpreting as "0" for backwards compatibility in %s on line %d
410
42