On Thu, Jun 23, 2011 at 7:16 PM, Jordi Boggiano <j.boggi...@seld.be> wrote:
> Thanks for the great work. More should be done on the front of helping > newcomers solve trivial issues imo. > > On 23.06.2011 20:08, Felipe Pena wrote: > > $ sapi/cli/php -r 'class ' > > Current: > > Parse error: syntax error, unexpected $end, expecting T_STRING > > > > Patched: > > Parse error: syntax error, unexpected end of file, expecting > > 'identifier' (T_STRING) > > identifier should not be quoted. The quotes are fine for "expecting '{'" > and "unexpected 'foo'" because those are text literals, but this implies > you were supposed to actually type "class identifier", which is > obviously not the intended message. > > > $ sapi/cli/php -r 'class abc foo' > > Current: > > Parse error: syntax error, unexpected T_STRING, expecting '{' in > > Command line code on line 1 > > > > Patched: > > Parse error: syntax error, unexpected 'foo' (T_STRING), expecting '{' > > in Command line code on line 1 > > > > > > As can be noticed, I added the actual scanned string in the > > "unexpected" part. This might be useful for finding really which makes > > the parser error. (It was a bit tricky though :D) > > Good stuff, maybe "unexpected string 'foo' (T_STRING)" or "unexpected > string (T_STRING) 'foo'" would be more clear, but no big deal really. > > Cheers > > -- > Jordi Boggiano > @seldaek - http://nelm.io/jordi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Good work Felipe! the $end was very ambiguous :-)