php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: moondream at moondream dot de
New email:
PHP Version: OS:

 

 [2005-11-26 09:02 UTC] moondream at moondream dot de
Description:
------------
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:
---------------
<?php

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

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:


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-26 10:05 UTC] tony2001@php.net
Marcus, it's your patch causes this.
 [2005-11-26 14:14 UTC] helly@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC