Bug #80508 [NEW]: Union types in class not working properly
| From: | dvworkmail2017 at gmail dot com | Date: | Sun, 13 Dec 2020 02:05:02 +0000 |
| Subject: | Bug #80508 [NEW]: Union types in class not working properly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-231045@lists.php.net to get a copy of this message | ||
From: dvworkmail2017 at gmail dot com
Operating system: ubuntu 20
PHP version: 8.0.0
Package: *General Issues
Bug Type: Bug
Bug description:Union types in class not working properly
Description:
------------
Union types in class return double instead type error
Test script:
---------------
class Number
{
public function __construct(
private int | float $number
) {
print_r(gettype($number));
exit();
}
}
new Number("1.0");
Expected result:
----------------
Excepted Output should be: TypeError
Actual result:
--------------
Current Output is: double
--
Edit bug report at https://bugs.php.net/bug.php?id=80508&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80508&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80508&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80508&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80508&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80508&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80508&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80508&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80508&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80508&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80508&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80508&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80508&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80508&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80508&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80508&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80508&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80508&r=mysqlcfg