php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27237 Working with simplexml crashes apache2
Submitted: 2004-02-13 00:20 UTC Modified: 2004-02-13 09:59 UTC
From: gerry dot rodman at ness-usa dot com Assigned:
Status: Closed Package: XML related
PHP Version: 5CVS-2004-02-12 (dev) OS: Windows 2003
Private report: No CVE-ID:
 [2004-02-13 00:20 UTC] gerry dot rodman at ness-usa dot com
Description:
------------
VERSION INFO: I am using the BETA 4 Release published on 2/2/04. (This was not available in the Version drop down).

Also running on Apache 2

Run the code below in IE 6.  When it returns, refresh the browser (CTRL-R).  It will crash Apache2 everytime.

The last version of the code I was working with prior to BETA 4 was a 2/1/04 snapshot.  I tested this specific code using that snapshot..no error... but (as I said) it blows up on BETA4. I would like to call your attention to another bug I reported which I believe was first fixed in RC4.  This may be worth looking at since it was also a SimpleXML problem.  Perhaps fixing this bug is related to the current bug.  I am just guessing here.  The url for the fixed bug is:
http://bugs.php.net/bug.php?id=27115

Thank you,

gr


Reproduce code:
---------------
<?
  class ThemeInstance
  {
    public $name;
    public function __construct($ti)
    {
      $this->name = $ti->name;
    }
  }
  class Holder 
  {
  public $themeCurrent;
  public function __construct()
    {
    $xml = '<themes><theme><name>blue</name></theme></themes>';
    $config = simplexml_load_string($xml); 
    $themeInstance = new ThemeInstance($config->theme);
    $this->themeCurrent = $themeInstance;
    }
  }
  $h = new Holder();
  $x = $h->themeCurrent;
  echo $x->name;  // This statement causes it to blow
?>

Expected result:
----------------
I expect it to print the word "blue" and when I refresh the browser (CTRL-R) to print the word "blue" again

Actual result:
--------------
It prints the word "blue".  If I refresh the browser it crashes Apache2.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-13 09:59 UTC] rrichards@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-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 12:02:07 2014 UTC