Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9401
| From | SwissCheese <swisscheese@cfl.rr.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: bug in is_numeric |
| Date | 2013-05-16 22:34 -0400 |
| Organization | cheese... |
| Message-ID | <kn44no$cs5$1@dont-email.me> (permalink) |
| References | (7 earlier) <16716194.HF93PK6e1C@PointedEars.de> <kmpc98$gs4$1@dont-email.me> <9274580.Q9cWkUkHO0@PointedEars.de> <kn3maj$g1u$1@dont-email.me> <2538859.UtKtqhLufE@PointedEars.de> |
On 05/16/2013 06:33 PM, Thomas 'PointedEars' Lahn wrote:
> SwissCheese wrote:
>
>> On 05/13/2013 05:07 AM, Thomas 'PointedEars' Lahn wrote:
>>> It is a string value whose suitability to serve as a numeric value is
>>> being tested with is_numeric(). Therefore it matters what the PHP
>>> grammar has to say about numeric values.
>>>
>>>>> is_numeric('x11.11c')
>>>>>
>>>>> must return FALSE. By contrast, is_numeric('0x11') returns TRUE.
>>>>
>>>> is_numeric('0x11') has nothing to do with the problem at hand.
>>>
>>> Yes, it has. Both the added “0” prefix and the omitted “.11c” suffix
>>> make “0x11” a proper numeric (hexadecimal integer) representation as per
>>> the PHP
>>> grammar. Which is what is_numeric() is supposed to test.
>>
>> is_numeric() checks to see if the first two characters are '0x' (or
>> '0X'), but it does not add a leading '0' if the first character is an
>> 'x' (or 'X')... nor does it simply omit the part that is not a number
>> '.11c'. is_numeric() checks the string as passed without altering it.
>
> Aside from getting a real name and learning to quote only the relevant parts
> of what you are replying to, you want to learn to read what you quote more
> carefully. I have not even implied that is_numeric() adds anything.
>
Aside from the fact that I'm fairly sure 'Pointed Ears' is not part
of -your- real name, maybe you would notice that my real name is in my
signature.
>>>>> However, there appears to be an *actual* mismatch between PHP manual
>>>>> and implementation in said PHP version as
>>>>>
>>>>> is_numeric('0b11001001')
>>>>>
>>>>> returns FALSE when according to the manual it should return TRUE
>>>>> (binary integer literals are available since PHP 5.4.0 per the manual,
>>>>> and they do compile and properly evaluate in tests there.
>>
>> Correct as per my other reply.
>
> It is not correct if the manual says something else, and it does. Either
> the manual or the implementation is wrong.
>
>
'Correct' in that the documentation is wrong... as I stated in another
reply.
> PointedEars
>
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
bug in is_numeric fred <email@address.com> - 2013-05-12 15:22 +0100
Re: bug in is_numeric Salvatore <sal@yojimbo.hack.invalid> - 2013-05-12 15:31 +0000
Re: bug in is_numeric Luuk <luuk@invalid.lan> - 2013-05-12 17:55 +0200
Re: bug in is_numeric Luuk <luuk@invalid.lan> - 2013-05-12 17:58 +0200
Re: bug in is_numeric Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-05-12 18:06 +0200
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-12 16:24 +0000
Re: bug in is_numeric fred <email@address.com> - 2013-05-12 18:41 +0100
Re: bug in is_numeric Erwin Moller <erwinmollerusenet@xs4all.nl> - 2013-05-13 13:50 +0200
Re: bug in is_numeric fred <email@address.com> - 2013-05-13 14:58 +0100
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 10:11 -0400
Re: bug in is_numeric fred <email@address.com> - 2013-05-13 15:15 +0100
Re: bug in is_numeric Erwin Moller <erwinmollerusenet@xs4all.nl> - 2013-05-13 17:29 +0200
Re: bug in is_numeric "J.O. Aho" <user@example.net> - 2013-05-13 19:55 +0200
Re: bug in is_numeric Richard Yates <richard@yatesguitar.com> - 2013-05-14 06:41 -0700
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-14 21:43 -0400
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-14 23:01 -0400
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-15 05:48 -0400
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-15 06:11 -0400
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 18:36 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-15 15:19 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-15 20:23 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-15 20:49 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-15 21:58 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-15 22:20 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-15 22:42 +0200
Re: bug in is_numeric Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-05-15 23:53 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-16 00:29 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-16 00:40 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-16 05:00 +0200
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 18:16 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-17 00:45 +0200
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 22:52 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-17 18:33 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-17 20:39 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-17 23:45 +0200
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-18 14:47 +0200
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-15 20:57 -0400
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-16 00:09 -0400
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-17 01:17 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-16 20:30 -0400
Re: bug in is_numeric Christoph Becker <cmbecker69@gmx.de> - 2013-05-18 14:51 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 10:07 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-18 11:56 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 14:32 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-18 22:24 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 17:01 -0400
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-18 21:58 +0000
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 19:21 -0400
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-19 02:22 +0000
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 22:41 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 05:28 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 09:42 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:42 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 14:39 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-21 01:01 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-21 05:59 -0400
Re: bug in is_numeric The Natural Philosopher <tnp@invalid.invalid> - 2013-05-19 07:49 +0100
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 05:31 -0500
Re: bug in is_numeric The Natural Philosopher <tnp@invalid.invalid> - 2013-05-19 12:39 +0100
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 09:43 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:52 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 14:42 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-21 01:03 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-21 06:00 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:45 -0500
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 05:27 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 09:45 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:37 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 14:43 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-21 00:59 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-21 06:02 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-18 17:08 -0500
Re: bug in is_numeric The Natural Philosopher <tnp@invalid.invalid> - 2013-05-18 23:58 +0100
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 19:22 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-18 17:11 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 19:23 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 05:35 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 09:46 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:23 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-19 14:44 -0400
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-21 00:54 -0500
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-21 06:03 -0400
Re: bug in is_numeric fred <email@address.com> - 2013-05-23 15:38 +0100
Re: bug in is_numeric Arno Welzel <usenet@arnowelzel.de> - 2013-06-01 17:36 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-01 14:54 -0400
Re: bug in is_numeric Arno Welzel <usenet@arnowelzel.de> - 2013-06-05 15:25 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-05 10:34 -0400
Re: bug in is_numeric Arno Welzel <usenet@arnowelzel.de> - 2013-06-05 17:02 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-05 12:30 -0400
OT: What you say is not always what you mean (was: Re: bug in is_numeric) Arno Welzel <usenet@arnowelzel.de> - 2013-06-05 20:20 +0200
Re: OT: What you say is not always what you mean Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-05 14:40 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-18 21:51 +0200
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-18 17:13 -0500
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-19 00:49 +0200
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 05:24 -0500
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-19 12:40 +0200
Re: bug in is_numeric The Natural Philosopher <tnp@invalid.invalid> - 2013-05-19 12:43 +0100
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-19 11:29 -0500
Re: bug in is_numeric Norman Peelman <npeelman@cfl.rr.com> - 2013-05-18 14:53 -0400
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 18:41 -0400
Re: bug in is_numeric Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-13 08:35 -0700
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-13 20:26 +0000
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-13 20:15 +0000
Re: bug in is_numeric Robert Heller <heller@deepsoft.com> - 2013-05-12 13:03 -0500
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 18:03 +0200
Re: bug in is_numeric fred <email@address.com> - 2013-05-12 18:34 +0100
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 19:40 +0200
Re: bug in is_numeric Luuk <luuk@invalid.lan> - 2013-05-12 21:51 +0200
Re: bug in is_numeric "Sanders Kaufman" <bucky@kaufman.net> - 2013-05-12 11:47 -0500
Re: bug in is_numeric Luuk <luuk@invalid.lan> - 2013-05-12 18:56 +0200
Re: bug in is_numeric Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2013-05-12 19:05 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 19:38 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 19:46 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-12 14:11 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 20:39 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-12 16:51 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 01:27 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-12 20:35 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 11:07 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 09:02 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 16:57 +0200
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 17:10 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 13:52 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 20:28 +0200
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 18:28 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-17 00:33 +0200
Re: bug in is_numeric SwissCheese <swisscheese@cfl.rr.com> - 2013-05-16 22:34 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-18 10:28 +0200
Re: bug in is_numeric Norman Peelman <npeelman@cfl.rr.com> - 2013-05-18 08:00 -0400
Re: bug in is_numeric Luuk <luuk@invalid.lan> - 2013-05-18 14:18 +0200
Re: bug in is_numeric Tim Streater <timstreater@greenbee.net> - 2013-05-18 13:20 +0100
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 08:47 -0400
Re: bug in is_numeric The Natural Philosopher <tnp@invalid.invalid> - 2013-05-18 14:05 +0100
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-18 10:16 -0400
Re: bug in is_numeric Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-18 16:14 +0200
Re: bug in is_numeric Sandman <mr@sandman.net> - 2013-05-14 10:34 +0200
Re: bug in is_numeric fred <email@address.com> - 2013-05-14 14:47 +0100
Re: bug in is_numeric Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-14 14:54 +0000
Re: bug in is_numeric Sandman <mr@sandman.net> - 2013-05-15 08:05 +0200
Re: bug in is_numeric Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-15 06:27 -0400
Re: bug in is_numeric Erwin Moller <erwinmollerusenet@xs4all.nl> - 2013-05-15 13:11 +0200
csiph-web