mirror of
https://github.com/php/php-src.git
synced 2026-04-25 17:08:14 +02:00
fbe30592d6
From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
23 lines
599 B
PHP
23 lines
599 B
PHP
--TEST--
|
|
Bug #48227 (NumberFormatter::format leaks memory)
|
|
--SKIPIF--
|
|
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$x = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
|
|
foreach (['', 1, NULL, $x] as $value) {
|
|
try {
|
|
var_dump($x->format($value));
|
|
} catch (TypeError $ex) {
|
|
echo $ex->getMessage(), PHP_EOL;
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
NumberFormatter::format(): Argument #1 ($value) must be of type int|float, string given
|
|
string(1) "1"
|
|
string(1) "0"
|
|
NumberFormatter::format(): Argument #1 ($value) must be of type int|float, NumberFormatter given
|