From: mezger dot michael at t-online dot de
Operating system: Windows 2000 Server
PHP version: 5.0.1
PHP Bug Type: DOM XML related
Bug description: setting the formatOutput property doesnt work within a
subclass
Description:
------------
I made a subclass which extends the domdocument class. When i try to set
the formatOutput or preserveWhiteSpace property within this subclass, it
doesnt work.
when i create a domdocument object and set it not through a subclass, it
works fine. I dont know if this is a bug?!
Reproduce code:
---------------
class guestbook extends domdocument {
function guestbook($file){
$this->preserveWhiteSpace = FALSE;
$this->formatOutput = TURE; //format the guestbook.xml
$this->load($file); //load XML File
$this->save($file);
}
}
$guestbook = new guestbook("test.xml");
var_dump($guestbook->preserveWhiteSpace); //echo: (boolean) true
var_dump($guestbook->formatOutput); //echo: (boolean) false
//This code above works
$guestbook2 = new domdocument();
$guestbook2->load("test.xml");
$guestbook2->preserveWhiteSpace = FALSE;
$guestbook2->formatOutput = TRUE;
var_dump($guestbook2->preserveWhiteSpace); //echo: (boolean) false
var_dump($guestbook2->formatOutput); //echo: (boolean) true
--
Edit bug report at http://bugs.php.net/?id=31934&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31934&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31934&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31934&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31934&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31934&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31934&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31934&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31934&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31934&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31934&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31934&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31934&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31934&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31934&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31934&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31934&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31934&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31934&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31934&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31934&r=mysqlcfg