xref: /PHP-5.6/ext/intl/tests/bug48227.phpt (revision 6d04f1a1)
1--TEST--
2Bug #48227 (NumberFormatter::format leaks memory)
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7
8$x = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
9var_dump($x->format(''));
10var_dump($x->format(1));
11var_dump($x->format(NULL));
12var_dump($x->format($x));
13
14?>
15--EXPECTF--
16string(1) "0"
17string(1) "1"
18string(1) "0"
19
20Notice: Object of class NumberFormatter could not be converted to int in %s on line %d
21string(1) "1"
22