php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33454 Semgantation fault performing eval in __destruct()
Submitted: 2005-06-23 17:08 UTC Modified: 2005-06-23 20:50 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: carlo dot razzeto at mtginfo dot com Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.0.4 OS: (Red Hat Linux 3.2.3-47)
Private report: No CVE-ID: None
 [2005-06-23 17:08 UTC] carlo dot razzeto at mtginfo dot com
Description:
------------
The latest release of PHP5 will segmantation fault when performing the following an eval which accesses a member variable of the class, setting another variable to it's value.

Reproduce code:
---------------
class test {
    var $test = true;
    function __construct() {
        //Constructor
    }
    
    function __destruct() {
        $variable = 'test';
        $test = true;
        eval( '$check = $this->'.$variable.';' );
        if( $check ) {
            echo "Hello\n";
        }
    }
    
}

$o_test = new test();

Expected result:
----------------
Hello
prompt: 

Actual result:
--------------
Segmantation Fault:
prompt:

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-23 20:15 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-06-23 20:29 UTC] kermodebear at kermodebear dot org
I tried the latest CVS release and this seems to have fixed the issue.
 [2005-06-23 20:50 UTC] tony2001@php.net
Works fine -> closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 18:01:32 2024 UTC