Bug #77010 [NEW]: is_numeric returns false for numeric strings

From: Date: Sat, 13 Oct 2018 20:46:22 +0000
Subject: Bug #77010 [NEW]: is_numeric returns false for numeric strings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217545@lists.php.net to get a copy of this message
From:             carusogabriel
Operating system: Irrelevant
PHP version:      Irrelevant
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:is_numeric returns false for numeric strings

Description:
------------
As discussed in https://github.com/phpstan/phpstan/issues/1497,
there're
some strings containing castable integers, for example:
https://3v4l.org/Ogral, that reports as false when passing it
to
is_numeric.

I'm opening this bug ticket to discuss if we need to consider this a bug
and target all active branches, or consider as a Feature Request and
propose this as a new feature to the next minor version of PHP.

Test script:
---------------
<?php

var_dump(is_numeric('2.14.0-DEV'));

Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=77010&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77010&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77010&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77010&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77010&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77010&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77010&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77010&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77010&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77010&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77010&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77010&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77010&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77010&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77010&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77010&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77010&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77010&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77010&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77010&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77010&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#217545) next »