Bug #77101 [Com]: Wrong error message on unexpected token
| From: | php4fan at gmail dot com | Date: | Fri, 13 Nov 2020 18:50:51 +0000 |
| Subject: | Bug #77101 [Com]: Wrong error message on unexpected token | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230348@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
Comment by: php4fan at gmail dot com
Reported by: teo8976 at gmail dot com
Summary: Wrong error message on unexpected token
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: all
PHP Version: 7.3.0RC4
Block user comment: N
Private report: N
New Comment:
Related: https://bugs.php.net/bug.php?id=80365
Previous Comments:
------------------------------------------------------------------------
[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