Bug #79694 [NEW]: Whether a numeric constant needs to be an integer

From: Date: Fri, 12 Jun 2020 01:28:18 +0000
Subject: Bug #79694 [NEW]: Whether a numeric constant needs to be an integer
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227434@lists.php.net to get a copy of this message
From: cxlblm at gmail dot com Operating system: macos 10.15.5 PHP version: 7.4.7 Package: *General Issues Bug Type: Bug Bug description:Whether a numeric constant needs to be an integer Description: ------------ We can see https://3v4l.org/tmcO4 What is the type of numeric constant Test script: --------------- <?php declare(strict_types=1); function testFloat(): float { return 1; } var_dump(is_float(testFloat())); var_dump(is_float(1)); function testInteger(): int { return 1; } var_dump(is_int(testInteger())); var_dump(is_int(1)); -- Edit bug report at https://bugs.php.net/bug.php?id=79694&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79694&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79694&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79694&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79694&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79694&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79694&r=support Expected behavior: https://bugs.php.net/fix.php?id=79694&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79694&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79694&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79694&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79694&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79694&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79694&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79694&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79694&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79694&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79694&r=mysqlcfg

« previous php.bugs (#227434) next »