rfc:improved-parser-error-message

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:improved-parser-error-message [2011/05/16 12:46] – new info feliperfc:improved-parser-error-message [2011/08/06 19:28] – [Request for Comments: Improved parser error message] stas
Line 3: Line 3:
   * Date: 2011-05-16   * Date: 2011-05-16
   * Author: Felipe Pena <felipe@php.net>   * Author: Felipe Pena <felipe@php.net>
-  * Status: Under Discussion+  * Status: Implemented in 5.4 
 +  * Discussion: [[http://markmail.org/thread/2vptpqr72xumbfsh|May 16, 2011]]
  
  
Line 20: Line 21:
  
 ==== Examples ==== ==== Examples ====
 +
 +<code>
 +$ sapi/cli/php -r 'class abc foo'
 +Patched:
 +Parse error: syntax error, unexpected 'foo' (T_STRING), expecting '{' in Command line code on line 1
 +
 +Current:
 +Parse error: syntax error, unexpected T_STRING, expecting '{' in Command line code on line 1
 +</code>
  
 <code> <code>
 $ sapi/cli/php -r 'function ""' $ sapi/cli/php -r 'function ""'
 Patched: Patched:
-Parse error: syntax error, unexpected quoted-string, expecting identifier or '(' in Command line code on line 1+Parse error: syntax error, unexpected '""' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or '(' in Command line code on line 1
  
 Current: Current:
Line 33: Line 43:
 $ sapi/cli/php -r 'echo ::a;' $ sapi/cli/php -r 'echo ::a;'
 Patched: Patched:
-Parse error: syntax error, unexpected :: in Command line code on line 1+Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in Command line code on line 1 
 +nexpected '::' in Command line code on line 1
  
 Current: Current:
Line 42: Line 53:
 $ sapi/cli/php -r 'echo <<=' $ sapi/cli/php -r 'echo <<='
 Patched: Patched:
-Parse error: syntax error, unexpected <<= in Command line code on line 1+Parse error: syntax error, unexpected '<<=' (T_SL_EQUAL) in Command line code on line 1
  
 Current: Current:
Line 48: Line 59:
 </code> </code>
  
 +<code>
 +$ sapi/cli/php -r 'class '
 +Patched:
 +Parse error: syntax error, unexpected end of file, expecting identifier (T_STRING) in Command line code on line 1
 +
 +Current:
 +Parse error: syntax error, unexpected $end, expecting T_STRING in Command line code on line 1
 +</code>
 ===== Patch ===== ===== Patch =====
  
   * http://felipe.ath.cx/diff/improved-error-message.diff   * http://felipe.ath.cx/diff/improved-error-message.diff
  
rfc/improved-parser-error-message.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1