rfc:improved-parser-error-message
This is an old revision of the document!
Request for Comments: Improved parser error message
- Version: 1.0
- Date: 2011-05-16
- Author: Felipe Pena felipe@php.net
- Status: Under Discussion
Introduction
The purpose of this RFC is to propose a naming of our tokens to have an crypto-less parser error messages. This is simply achieved by using an old Bison feature.
Examples
$ sapi/cli/php -r 'function ""' Patched: Parse error: syntax error, unexpected quoted-string, expecting identifier or '(' in Command line code on line 1 Current: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or '(' in Command line code on line 1
$ sapi/cli/php -r 'echo ::a;' Patched: Parse error: syntax error, unexpected :: in Command line code on line 1 Current: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in Command line code on line 1
$ sapi/cli/php -r 'echo <<=' Patched: Parse error: syntax error, unexpected <<= in Command line code on line 1 Current: Parse error: syntax error, unexpected T_SL_EQUAL in Command line code on line 1
Patch
rfc/improved-parser-error-message.1305548000.txt.gz · Last modified: 2025/04/03 13:08 (external edit)