Bug #79989 [NEW]: new `match` keyword is inconsistant in syntax errors
| From: | call dot user dot func at gmail dot com | Date: | Tue, 18 Aug 2020 10:02:55 +0000 |
| Subject: | Bug #79989 [NEW]: new `match` keyword is inconsistant in syntax errors | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228633@lists.php.net to get a copy of this message | ||
From: call dot user dot func at gmail dot com
Operating system: W10
PHP version: 8.0.0beta1
Package: *General Issues
Bug Type: Bug
Bug description:new
match keyword is inconsistant in syntax errors
Description:
------------
Stated in this RFC:
https://wiki.php.net/rfc/match_expression_v2#backward_incompatible_changes
we have this new keyword match which now result in syntax errors when
used as a namespaces, class names, function names, global constants.
Well, this behaviour is not consistant with the RFC and also
inconsistent between the alpha3 and all other pre-release versions of
php8.
My tests are in the attached test scripts.
Greetz Roland
Test script:
---------------
<?php
define("match", 1); // no error in php8.0.0beta1
class Match{} // error in php8.0.0beta1
function match(){} // error in php8.0.0beta1
namespace match{} // only error in php8.0.0alpha3
namespace Foo\Bar\Match; // only error in php8.0.0alpha3
--
Edit bug report at https://bugs.php.net/bug.php?id=79989&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79989&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79989&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79989&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79989&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79989&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79989&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79989&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79989&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79989&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79989&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79989&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79989&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79989&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79989&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79989&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79989&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79989&r=mysqlcfg