From 2891a305f14cb71a1d9cd76c960a1ae5a6a3e3d3 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Fri, 3 Jun 2016 13:28:47 +0000 Subject: [PATCH] Document behavior of NaN/Inf to int casts As of PHP 7.0.0 this results in int(0); formerly it has been undefined. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339291 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/types/integer.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/language/types/integer.xml b/language/types/integer.xml index c17c2fd3b1..f9aceea179 100644 --- a/language/types/integer.xml +++ b/language/types/integer.xml @@ -226,6 +226,13 @@ var_dump(round(25/7)); // float(4) have enough precision to give an exact integer result. No warning, not even a notice will be issued when this happens! + + + + Instead of being undefined and platform-dependent, NaN and Infinity will + always be zero when cast to integer as of PHP 7.0.0. + +