Skip to content

Commit 55266d4

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-16473: dom_import_simplexml stub is wrong
2 parents d8e5166 + c26d5f2 commit 55266d4

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ PHP NEWS
3232
(nielsdos)
3333
. Fixed bug GH-16336 (Attribute intern document mismanagement). (nielsdos)
3434
. Fixed bug GH-16338 (Null-dereference in ext/dom/node.c). (nielsdos)
35+
. Fixed bug GH-16473 (dom_import_simplexml stub is wrong). (nielsdos)
3536

3637
- EXIF:
3738
. Fixed bug GH-16409 (Segfault in exif_thumbnail when not dealing with a

ext/dom/php_dom.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ public static function quote(string $str): string {}
12341234
}
12351235
#endif
12361236

1237-
function dom_import_simplexml(object $node): DOMElement {}
1237+
function dom_import_simplexml(object $node): DOMAttr|DOMElement {}
12381238
}
12391239

12401240
namespace Dom
@@ -2168,5 +2168,5 @@ public static function quote(string $str): string {}
21682168
}
21692169
#endif
21702170

2171-
function import_simplexml(object $node): Element {}
2171+
function import_simplexml(object $node): Attr|Element {}
21722172
}

ext/dom/php_dom_arginfo.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/dom/tests/gh16473.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
GH-16473 (dom_import_simplexml stub is wrong)
3+
--EXTENSIONS--
4+
dom
5+
simplexml
6+
--FILE--
7+
<?php
8+
$root = simplexml_load_string('<root xmlns:x="urn:x" x:attr="foo"/>');
9+
$attr = $root->attributes('urn:x');
10+
var_dump(dom_import_simplexml($attr)->textContent);
11+
?>
12+
--EXPECT--
13+
string(3) "foo"

0 commit comments

Comments
 (0)