parent
74274f8328
commit
7973f99f47
4 changed files with 48 additions and 2 deletions
@ -0,0 +1,20 @@ |
|||||||
|
--TEST-- |
||||||
|
PHP 8.5 warns when pow overflow is narrowed to a native int |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_VERSION_ID < 80500) { |
||||||
|
die('skip requires PHP 8.5 or newer'); |
||||||
|
} |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
use native_types; |
||||||
|
function main(): void |
||||||
|
{ |
||||||
|
$value = 2 ** 80; |
||||||
|
echo $value, PHP_EOL; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
Warning: The float %s is not representable as an int, cast occurred in %s on line %d |
||||||
|
0 |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
--TEST-- |
||||||
|
PHP 8.5 warns when NAN is coerced to string |
||||||
|
--SKIPIF-- |
||||||
|
<?php |
||||||
|
if (PHP_VERSION_ID < 80500) { |
||||||
|
die('skip requires PHP 8.5 or newer'); |
||||||
|
} |
||||||
|
?> |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
function main(): void |
||||||
|
{ |
||||||
|
echo NAN . "\n"; |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
Warning: unexpected NAN value was coerced to string in %s on line %d |
||||||
|
NAN |
||||||
Loading…
Reference in new issue