mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
b2b2b437af
convert_scalar_to_number() will now call cast_object() with an _IS_NUMBER argument, in which case the cast handler should return either an integer or floating point number, whichever is more appropriate. Previously convert_scalar_to_number() unconditionally converted objects to integers instead. Fixes bug #53033. Fixes bug #54973. Fixes bug #73108.
22 lines
472 B
PHP
22 lines
472 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);
|
|
var_dump($x->format(''));
|
|
var_dump($x->format(1));
|
|
var_dump($x->format(NULL));
|
|
var_dump($x->format($x));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
string(1) "0"
|
|
string(1) "1"
|
|
string(1) "0"
|
|
|
|
Notice: Object of class NumberFormatter could not be converted to number in %s on line %d
|
|
string(1) "1"
|