From bbc0131c88b9df2ee901a19ca3b5736882bb2d6f Mon Sep 17 00:00:00 2001 From: Dejan Marjanovic Date: Tue, 5 Mar 2013 21:27:21 +0000 Subject: [PATCH] Updated is_numeric description and example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329671 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/var/functions/is-numeric.xml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/reference/var/functions/is-numeric.xml b/reference/var/functions/is-numeric.xml index 380bcb85ac..04068c885d 100644 --- a/reference/var/functions/is-numeric.xml +++ b/reference/var/functions/is-numeric.xml @@ -15,11 +15,12 @@ mixedvar - 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 +0123.45e6 is a valid numeric - value. Hexadecimal notation (0xFF) 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 +0123.45e6 is a valid numeric value. Hexadecimal (e.g. + 0xf4c3b00c), Binary (e.g. 0b10100111001), + Octal (e.g. 0777) notation is allowed too but only without + sign, decimal and exponential part. @@ -58,7 +59,10 @@ $tests = array( "42", 1337, - "1e4", + 0x539, + 02471, + 0b10100111001, + 1337e0, "not numeric", array(), 9.1 @@ -79,7 +83,10 @@ foreach ($tests as $element) {