mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
ce1d69a1f6
PHP requires integer typehints to be written "int" and does not allow "integer" as an alias. This changes type error messages to match the actual type name and avoids confusing messages like "must be of the type integer, integer given".
24 lines
439 B
PHP
24 lines
439 B
PHP
--TEST--
|
|
Bug #73954 (NAN check fails on Alpine Linux with musl)
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(NAN);
|
|
var_dump(is_nan(NAN));
|
|
|
|
function takes_int(int $int) {
|
|
}
|
|
|
|
takes_int(log(tan(3.14)));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
float(NAN)
|
|
bool(true)
|
|
|
|
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, float given, called in %s on line 9 and defined in %s:6
|
|
Stack trace:
|
|
#0 %s(9): takes_int(NAN)
|
|
#1 {main}
|
|
thrown in %s on line 6
|