|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35406 eval hangs when evall'ed code ends with comment w/o newline
Submitted: 2005-11-26 09:02 UTC Modified: 2005-11-26 14:14 UTC
From: moondream at moondream dot de Assigned: helly (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.1.0 OS: *
Private report: No CVE-ID: None
 [2005-11-26 09:02 UTC] moondream at moondream dot de
If the eval'ed code ends with a comment which is not termiated 
by a newline, eval hangs in an endless loop. If the comment is 
followed by a newline, there is no hang.

This causes phpBB2 on php 5.1 to hang.

Reproduce code:

$v='echo "Test\n"; // comment';

echo "Eval 1:";
eval ($w);
echo "Eval 2:";
eval ($v);

Expected result:
The code sample returns after printing:

Eval 1:Test
Eval 2:Test

Actual result:
The code hangs after:

Eval 1:Test
Eval 2:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-26 10:05 UTC]
Marcus, it's your patch causes this.
 [2005-11-26 14:14 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 07:01:25 2019 UTC