php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43278 If eval fails used memory will not freed anymore
Submitted: 2007-11-13 13:24 UTC Modified: 2007-11-14 11:45 UTC
From: kh dot wild at wicom dot li Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.5 OS: FreeBSD 6.2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kh dot wild at wicom dot li
New email:
PHP Version: OS:

 

 [2007-11-13 13:24 UTC] kh dot wild at wicom dot li
Description:
------------
When an eval fails on execution
the memory consumtions raises.

The script below simulates the 
situation.

Is that an memory-leak?


Reproduce code:
---------------
<?
   error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
   ini_set('error_reporting', 1 );

   for( $i = 0; $i < 100000; $i++ )
   {
      eval( '$x = / 1000' );
   }
   print( "finish\n" );
?>



Expected result:
----------------
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4864 bytes) in test.php(7) : eval()'d code on line 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-14 11:45 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 16:01:34 2025 UTC