Download src/php/php-src/ext/intl/tests/bug48227.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/intl/tests/bug48227.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/intl/tests/bug48227.phpt
-
curl -L -o bug48227.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/intl/tests/bug48227.phpt
673 Bytes
| --TEST-- | |
| Bug #48227 (NumberFormatter::format leaks memory) | |
| --EXTENSIONS-- | |
| intl | |
| --FILE-- | |
| $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; | |
| } | |
| } | |
| --EXPECTF-- | |
| NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given | |
| string(1) "1" | |
| Deprecated: NumberFormatter::format(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d | |
| string(1) "0" | |
| NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given | |