Skip to content

Commit 82eda28

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fix json_encode result on DOMDocument
2 parents 5abf4f2 + 6e468bb commit 82eda28

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PHP NEWS
1414
. Fix empty argument cases for DOMParentNode methods. (nielsdos)
1515
. Fixed bug GH-11791 (Wrong default value of DOMDocument::xmlStandalone).
1616
(nielsdos)
17+
. Fix json_encode result on DOMDocument. (nielsdos)
1718

1819
- FFI:
1920
. Fix leaking definitions when using FFI::cdef()->new(...). (ilutov)

ext/dom/php_dom.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
668668
* @readonly
669669
* @deprecated
670670
*/
671-
public mixed $config = null;
671+
public mixed $config;
672672

673673
public bool $formatOutput;
674674

ext/dom/php_dom_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
JSON encoding a DOMDocument
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
$doc = new DOMDocument;
8+
echo json_encode($doc);
9+
?>
10+
--EXPECT--
11+
{}

ext/dom/tests/domobject_debug_handler.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ var_dump($d);
1717
--EXPECTF--
1818
Deprecated: Creation of dynamic property DOMDocument::$dynamicProperty is deprecated in %s on line %d
1919
object(DOMDocument)#1 (39) {
20-
["config"]=>
21-
NULL
2220
["dynamicProperty"]=>
2321
object(stdClass)#2 (0) {
2422
}
@@ -46,6 +44,8 @@ object(DOMDocument)#1 (39) {
4644
bool(true)
4745
["documentURI"]=>
4846
string(%d) %s
47+
["config"]=>
48+
NULL
4949
["formatOutput"]=>
5050
bool(false)
5151
["validateOnParse"]=>

0 commit comments

Comments
 (0)