Bug->Req #67719 [Asn->Sus]: is_numeric treats leading and trailing spaces differently

From: Date: Tue, 17 Mar 2020 09:04:38 +0000
Subject: Bug->Req #67719 [Asn->Sus]: is_numeric treats leading and trailing spaces differently
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226128@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67719&edit=1

 ID:                 67719
 Updated by:         cmb@php.net
 Reported by:        bichinhoverde at spwinternet dot com dot br
 Summary:            is_numeric treats leading and trailing spaces
                     differently
-Status:             Assigned
+Status:             Suspended
-Type:               Bug
+Type:               Feature/Change Request
-Package:            *Math Functions
+Package:            Variables related
 Operating System:   Linux and Windows
 PHP Version:        5.5.15
 Assigned To:        ajf
 Block user comment: N
 Private report:     N

 New Comment:

Well, this is not really a bug, but rather common PHP behavior
regarding numeric strings[1].  Thus, I'm changing to feature
request and suspend the ticket, waiting on the outcome of the
"Permit trailing whitespace in numeric strings" RFC[2].

[1] <https://github.com/php/php-langspec/blob/master/spec/05-types.md#the-string-type>
[2] <https://wiki.php.net/rfc/trailing_whitespace_numerics>


Previous Comments:
------------------------------------------------------------------------
[2020-03-17 09:03:47] cmb@php.net

Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349477
Log: is_numeric() accepts leading whitespace

Cf. bug #67719.

------------------------------------------------------------------------
[2019-02-12 06:48:03] progr-d at yandex dot ru

This bug not fixed in php7.3.1

------------------------------------------------------------------------
[2014-07-30 15:22:36] bichinhoverde at spwinternet dot com dot br

Description:
------------
is_numeric(" 1") is true
is_numeric("1 ") is false




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67719&edit=1


Thread (3 messages)

« previous php.bugs (#226128) next »