|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77101 Wrong error message on unexpected token
Submitted: 2018-11-03 17:46 UTC Modified: 2021-02-05 21:44 UTC
From: teo8976 at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.3.0RC4 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: teo8976 at gmail dot com
New email:
PHP Version: OS:


 [2018-11-03 17:46 UTC] teo8976 at gmail dot com
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:

$a = ['foo'=>'bar'];


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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-03 20:16 UTC]
-Package: *Compile Issues +Package: Scripting Engine problem
 [2020-11-13 18:50 UTC] php4fan at gmail dot com
 [2021-02-05 21:44 UTC]
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-02-05 21:44 UTC]
Duplicate of feature request #47883.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 22:04:50 2022 UTC