|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #677 Infinite looping of for when include used in body of for
Submitted: 1998-08-21 08:57 UTC Modified: 1998-08-21 09:03 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: xkosj06 at vse dot cz Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.3 OS: Win NT 4.0 Workstation
Private report: No CVE-ID: None
 [1998-08-21 08:57 UTC] xkosj06 at vse dot cz
I have written script, which should include somefile.txt 
for example ten times:

    include "somefile.txt";

When I have ran this script, I have obtained 10 warnings,
stating that PHP can not include somefile.txt. After that,
PHP starts including somefile.txt in infinite loop.

I have tryed same code using alternate for syntax:

    include "somefile.txt";

And everything worked well. Everything worked also if I 
rewrite this piece of code to use while loop.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-21 09:03 UTC] zeev
include(), require(), eval() and basically any statement
that executes other code isn't considered as a single
statement, but as a statement list.  Therefore, they cannot
reside inside non-encapsulated loops.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Oct 04 05:05:54 2022 UTC