xref: /PHP-8.1/ext/intl/tests/bug53512.phpt (revision 74859783)
1--TEST--
2Bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values)
3--EXTENSIONS--
4intl
5--SKIPIF--
6<?php if (PHP_INT_SIZE != 8) die('skip 64-bit only');
7?>
8--FILE--
9<?php
10
11$badvals = array(4294901761, 2147483648, -2147483648, -1);
12
13foreach ($badvals as $val) {
14    $x = numfmt_create("en", NumberFormatter::PATTERN_DECIMAL);
15    var_dump(numfmt_set_symbol($x, $val, ""));
16    var_dump(intl_get_error_message());
17}
18
19?>
20--EXPECT--
21bool(false)
22string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
23bool(false)
24string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
25bool(false)
26string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
27bool(false)
28string(65) "numfmt_set_symbol: invalid symbol value: U_ILLEGAL_ARGUMENT_ERROR"
29