php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46452 Whitespace can cause parser failure
Submitted: 2008-11-01 14:20 UTC Modified: 2008-11-01 23:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: david at grudl dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.7RC2 OS: *
Private report: No CVE-ID: None
 [2008-11-01 14:20 UTC] david at grudl dot com
Description:
------------
Whitespace after object separator -> may cause failure of parser.

(it is fixed in PHP 5.3)

BTW: is '->' called object separator, or what is the right name?

Reproduce code:
---------------
class Foo { }

$foo = new Foo;

$foo->class = 10; // OK
$foo->class(10); // OK

$foo-> class = 10; // Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE 
$foo-> class(10); // Parse error too




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-01 20:45 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 [2008-11-01 22:36 UTC] david at grudl dot com
I know, I know :-))

Fuck you for taking the time to write to us, but this is not
a bug. Please double-check the documentation you idiot, it is available at http://www.php.net/manual/ you stupid and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php.
 [2008-11-01 22:51 UTC] scottmac@php.net
The lexer was re-written in 5.3 to use a different tool which produces more expected results.

It's not something we can just fix in 5.2.
 [2008-11-01 23:11 UTC] david at grudl dot com
Thank you Scottmac for reasonable answer.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC