php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79988 new reserved keyword `match` is a backward incompatible change
Submitted: 2020-08-18 09:05 UTC Modified: 2020-08-18 10:39 UTC
From: call dot user dot func at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 8.0.0beta1 OS:
Private report: No CVE-ID: None
 [2020-08-18 09:05 UTC] call dot user dot func at gmail dot com
Description:
------------
I am testing php8 on my project. One project have `Match` as a class name. In PHP8 this is now a syntax error. See: https://3v4l.org/ZTsft

It should be really dcoumented in https://github.com/php/php-src/blob/php-8.0.0beta1/UPGRADING -> 1. Backward Incompatible Changes

instead of hidden in 2. New Features -> Added support for `match` expression. RFC: https://wiki.php.net/rfc/match_expression_v2

This could be a real frustrating one in some projects. As in my case, the class name is database related and i can't change it easily.

Test script:
---------------
class Match{
    
    static function foo(){}
}

Match::foo();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-18 09:07 UTC] call dot user dot func at gmail dot com
-Summary: new reserved keyword `match` is and backward incompatible change +Summary: new reserved keyword `match` is a backward incompatible change
 [2020-08-18 09:07 UTC] call dot user dot func at gmail dot com
Title fix
 [2020-08-18 10:39 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Documentation Problem +Type: Bug -Assigned To: +Assigned To: cmb
 [2020-08-18 10:40 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4514afc1875bedf4dc07cb457f8ef5c986a7ca55
Log: Fix #79988: new reserved keyword `match` is a backward incompatible change
 [2020-08-18 10:40 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 18:01:32 2024 UTC