php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38663 $doc = new DOMDocument() crash
Submitted: 2006-08-31 06:43 UTC Modified: 2006-09-01 07:16 UTC
From: imre dot koloszar at gmail dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.1.6 OS: Windows XP, SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: imre dot koloszar at gmail dot com
New email:
PHP Version: OS:

 

 [2006-08-31 06:43 UTC] imre dot koloszar at gmail dot com
Description:
------------
$doc = new DOMDocument('1.0','utf-8') crash


Reproduce code:
---------------
There is a short example in the help which crashes the whole PHP processing at the first row. 

Example 1. Creating a Document

<?php
$doc = DOMDocument::loadHTML("<html><body>Test<br></body></html>");
echo $doc->saveHTML();

$doc = new DOMDocument();
$doc->loadHTML("<html><body>Test<br></body></html>");
echo $doc->saveHTML();
?>  


Expected result:
----------------
just work properly

Actual result:
--------------
I have used the PHP 5.1.6 release (installed with compiled Windows Binaries) with Apache 2.2.3, debugging with Komodo 3.5. At the mentioned line the debug process was broken.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-31 08:25 UTC] tony2001@php.net
Works perfectly fine here.

>At the mentioned line the debug process was broken.
What does this mean and why do you call this "crash"?
 [2006-09-01 06:54 UTC] imre dot koloszar at gmail dot com
Sorry, I'm quite new in PHP debugging. So this is the correct error message, I received in the log file after running this short php code. Could you help me, what does this 'zend.ze1_compatibility_mode' mean, and what shell I do to solve this problem? Thanks.

--------------------------------------
?php
   $doc = new DOMDocument('1.0');
?>
--------------------------------------

[01-Sep-2006 08:45:25] PHP Stack trace:
[01-Sep-2006 08:45:25] PHP   1. {main}() E:\WORK2\PHP\helloworld\___dom.php:0
[01-Sep-2006 08:45:25] PHP Fatal error:  Cannot clone object of class DOMDocument due to 'zend.ze1_compatibility_mode' in E:\WORK2\PHP\helloworld\___dom.php on line 2
 [2006-09-01 07:10 UTC] imre dot koloszar at gmail dot com
OK, I`ve managed the problem whith switching 
zend.ze1_compatibility_mode = Off 
in my php.ini.

It was On before. 

I don`t know if that is a problem or not, but I can now keep going with my work. 
Any way thank you for the support. By.
 [2006-09-01 07:16 UTC] bjori@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

Under ze1: $doc =& new DOMDocument();
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Apr 10 20:01:27 2020 UTC