php.net |  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
Votes:2
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
26 - 16 = ?
Subscribe to this entry?

 
 [2008-06-02 09:16 UTC] php at deegital dot de
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-27 20:39 UTC] johannes@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC