Refined string to int/float rules. #48496

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@281858 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Richard Quadling 2009-06-09 09:31:40 +00:00
parent 8d2863cf56
commit 2a2a9368dd

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.19 $ -->
<!-- $Revision: 1.20 $ -->
<sect1 xml:id="language.types.string">
<title>Strings</title>
@ -797,9 +797,11 @@ $str[strlen($str)-1] = 'e';
</simpara>
<simpara>
The <type>string</type> will be evaluated as a <type>float</type> if it
contains any of the characters '.', 'e', or 'E'. Otherwise, it will be
evaluated as an <type>integer</type>.
If the <type>string</type> does not contain any of the characters '.', 'e',
or 'E' and implied numeric value fits into integer type limits (as defined by
<constant>PHP_INT_MAX</constant>), the <type>string</type> will be evaluated
as an <type>integer</type>. In all other cases it will be evaluated as a
<type>float</type>.
</simpara>
<para>