Re: is_numeric_string an hexadecimal numbers ("123" == "0x7B")
| From: | Robert Williams | Date: | Tue, 17 Apr 2012 14:35:58 +0000 |
| Subject: | Re: is_numeric_string an hexadecimal numbers ("123" == "0x7B") | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60080@lists.php.net to get a copy of this message | ||
On Apr 17, 2012, at 5:39, "Hartmut Holzgraefe" <hartmut.holzgraefe@gmail.com<mailto:hartmut.holzgraefe@gmail.com>> wrote:
Same here, i never even knew that this worked in a string context
until recently. Autocast/comparison rules are already complicated
enough as they are documented now, and i failed to find anything
in the manual that would actually say that hex in a string
context is support to work at all ...
Would this end up changing the behavior of the user land is_numeric() function? The behavior
actually is documented under that function:
"Finds whether the given variable is numeric. Numeric strings consist of [...]. Hexadecimal
notation (0xFF) is allowed too but only without sign, decimal and exponential part."
If so, although this does technically break BC in that case, I for one will not miss it. The only
effect this will have on our code is to make validation of numeric input much easier and less
error-prone.
--
Bob Williams
Sent from my iPad
________________________________
Notice: This communication, including attachments, may contain information that is confidential. It
constitutes non-public information intended to be conveyed only to the designated recipient(s). If
the reader or recipient of this communication is not the intended recipient, an employee or agent of
the intended recipient who is responsible for delivering it to the intended recipient, or if you
believe that you have received this communication in error, please notify the sender immediately by
return e-mail and promptly delete this e-mail, including attachments without reading or saving them
in any manner. The unauthorized use, dissemination, distribution, or reproduction of this e-mail,
including attachments, is prohibited and may be unlawful. If you have received this email in error,
please notify us immediately by e-mail or telephone and delete the e-mail and the attachments (if
any).