svn: /phpdoc/en/trunk/reference/var/functions/ is-numeric.xml
| From: | Dejan Marjanovic | Date: | Tue, 05 Mar 2013 21:27:21 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/var/functions/ is-numeric.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-11073@lists.php.net to get a copy of this message | ||
dm Tue, 05 Mar 2013 21:27:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=329671
Log:
Updated is_numeric description and example
Changed paths:
U phpdoc/en/trunk/reference/var/functions/is-numeric.xml
Modified: phpdoc/en/trunk/reference/var/functions/is-numeric.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/is-numeric.xml 2013-03-05 21:21:59 UTC (rev 329670)
+++ phpdoc/en/trunk/reference/var/functions/is-numeric.xml 2013-03-05 21:27:21 UTC (rev 329671)
@@ -15,11 +15,12 @@
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<para>
- Finds whether the given variable is numeric. Numeric strings consist of
- optional sign, any number of digits, optional decimal part and optional
- exponential part. Thus <literal>+0123.45e6</literal> is a valid numeric
- value. Hexadecimal notation (<literal>0xFF</literal>) is allowed too but
- only without sign, decimal and exponential part.
+ Finds whether the given variable is numeric. Numeric strings consist of optional
+ sign, any number of digits, optional decimal part and optional exponential part.
+ Thus <literal>+0123.45e6</literal> is a valid numeric value. Hexadecimal (e.g.
+ <literal>0xf4c3b00c</literal>), Binary (e.g.
<literal>0b10100111001</literal>),
+ Octal (e.g. <literal>0777</literal>) notation is allowed too but only without
+ sign, decimal and exponential part.
</para>
</refsect1>
@@ -58,7 +59,10 @@
$tests = array(
"42",
1337,
- "1e4",
+ 0x539,
+ 02471,
+ 0b10100111001,
+ 1337e0,
"not numeric",
array(),
9.1
@@ -79,7 +83,10 @@
<![CDATA[
'42' is numeric
'1337' is numeric
-'1e4' is numeric
+'1337' is numeric
+'1337' is numeric
+'1337' is numeric
+'1337' is numeric
'not numeric' is NOT numeric
'Array' is NOT numeric
'9.1' is numeric