|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45147 unexpected T_ENDFOR
Submitted: 2008-06-02 09:16 UTC Modified: 2008-06-27 20:39 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: php at deegital dot de Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-06-02 (snap) OS: Vista 32Bit
Private report: No CVE-ID: None
 [2008-06-02 09:16 UTC] php at deegital dot de
Tokenizer seems to have problems with some php/html mix constructions (found this in a "compiled" smarty template)

Works, if if, else and endif is splitted into multiple lines

Reproduce code:
<?php for ($i = 0; $i == 0; $i++): ?>
		<?php if (true): ?>#<?php else: ?>#<?php endif; ?>
<?php endfor; ?>

Expected result:

Actual result:
Parse error: syntax error, unexpected T_ENDFOR in [foo] on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-27 20:39 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

bug #45372 is newer but about the same issues with more discussion. Closing this in favour of the other one.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 18 14:01:39 2019 UTC