Bug #77101 [Opn->Dup]: Wrong error message on unexpected token

From: Date: Fri, 05 Feb 2021 21:44:52 +0000
Subject: Bug #77101 [Opn->Dup]: Wrong error message on unexpected token
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231964@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77101&edit=1 ID: 77101 Updated by: cmb@php.net Reported by: teo8976 at gmail dot com Summary: Wrong error message on unexpected token -Status: Open +Status: Duplicate Type: Bug Package: Scripting Engine problem Operating System: all PHP Version: 7.3.0RC4 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Duplicate of feature request #47883. Previous Comments: ------------------------------------------------------------------------ [2020-11-13 18:50:51] php4fan at gmail dot com Related: https://bugs.php.net/bug.php?id=80365 ------------------------------------------------------------------------ [2018-11-03 17:46:35] teo8976 at gmail dot com Description: ------------ When a syntax error occurred where an unexpected kind of token is found, if the error message says "Unexpected X, expecting Y", then Y **MUST** be a completely exhaustive list of valid expected kinds of tokens. If there are too many, then just say "Unexpected X", but do not tell me "expecting Y" if Y is not the only valid option. See example Test script: --------------- <?php $a = ['foo'=>'bar']; unset($a['foo']; Expected result: ---------------- Either this: > syntax error, unexpected ';', expecting '::' (T_PAAMAYIM_NEKUDOTAYIM) or > ')' or [... add any other valid options] or this: > syntax error, unexpected ':', expecting '::' (T_PAAMAYIM_NEKUDOTAYIM) or > possibly something else. Actual result: -------------- syntax error, unexpected ';', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77101&edit=1

« previous php.bugs (#231964) next »