Bug #68512 [NEW]: DOMDocument specific properties in child class not used.

From: Date: Thu, 27 Nov 2014 08:20:53 +0000
Subject: Bug #68512 [NEW]: DOMDocument specific properties in child class not used.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188812@lists.php.net to get a copy of this message
From:             arjen at react dot com
Operating system: Linux
PHP version:      5.6.3
Package:          DOM XML related
Bug Type:         Bug
Bug description:DOMDocument specific properties in child class not used.

Description:
------------
When extending DOMDocument, it's class properties cannot be
overwritten/changed. DOMDocument's initial value are kept.

var_dump() however contains the actual new value, so behaviour is buggy
at least.

See http://3v4l.org/6H88X

Test script:
---------------
<?php

class A extends DOMDocument 
{
    public $formatOutput = true;
}
$a = new A;

var_dump($a->formatOutput); // false
var_dump($a); // Has formatOutput => true

Expected result:
----------------
bool(true)
object(A)#1 (34) {
  ["formatOutput"]=>
  bool(true)
  <<cut>>
}

Actual result:
--------------
bool(false)
object(A)#1 (34) {
  ["formatOutput"]=>
  bool(true)
  <<cut>>
}

-- 
Edit bug report at https://bugs.php.net/bug.php?id=68512&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=68512&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=68512&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=68512&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=68512&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=68512&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=68512&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=68512&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=68512&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=68512&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=68512&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=68512&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=68512&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=68512&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68512&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=68512&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=68512&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=68512&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68512&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=68512&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=68512&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#188812) next »