svn: /phpdoc/en/trunk/reference/var/functions/ floatval.xml intval.xml
| From: | Daniel Egeberg | Date: | Sat, 19 Dec 2009 10:59:29 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/var/functions/ floatval.xml intval.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5685@lists.php.net to get a copy of this message | ||
degeberg Sat, 19 Dec 2009 10:59:29 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292325
Log:
Fixed #50311.
Bug: http://bugs.php.net/50311 (Open) intval() vs
floatval(): same behavior but different documentation
Changed paths:
U phpdoc/en/trunk/reference/var/functions/floatval.xml
U phpdoc/en/trunk/reference/var/functions/intval.xml
Modified: phpdoc/en/trunk/reference/var/functions/floatval.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/floatval.xml 2009-12-19 10:06:50 UTC (rev 292324)
+++ phpdoc/en/trunk/reference/var/functions/floatval.xml 2009-12-19 10:59:29 UTC (rev 292325)
@@ -23,8 +23,8 @@
<term><parameter>var</parameter></term>
<listitem>
<para>
- May be any scalar type. You cannot use <function>floatval</function>
- on arrays or objects.
+ May be any scalar type. <function>floatval</function> should not be used
+ on objects, as doing so will emit an E_NOTICE level error and return 1.
</para>
</listitem>
</varlistentry>
@@ -34,7 +34,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- The float value of the given variable.
+ The float value of the given variable. Empty arrays return 0, non-empty
+ arrays return 1.
</para>
</refsect1>
<refsect1 role="examples">
Modified: phpdoc/en/trunk/reference/var/functions/intval.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/intval.xml 2009-12-19 10:06:50 UTC (rev 292324)
+++ phpdoc/en/trunk/reference/var/functions/intval.xml 2009-12-19 10:59:29 UTC (rev 292325)
@@ -16,7 +16,8 @@
<para>
Returns the <type>integer</type> value of <parameter>var</parameter>,
using the specified <parameter>base</parameter> for the conversion
- (the default is base 10).
+ (the default is base 10). <function>intval</function> should not be used
+ on objects, as doing so will emit an E_NOTICE level error and return 1.
</para>
</refsect1>
@@ -92,6 +93,8 @@
echo intval('420000000000000000000'); // 2147483647
echo intval(42, 8); // 42
echo intval('42', 8); // 34
+echo intval(array()); // 0
+echo intval(array('foo', 'bar')); // 1
?>
]]>
</programlisting>