Skip to content

Commit

Permalink
Merge branch 'PHP-8.3' into PHP-8.4
Browse files Browse the repository at this point in the history
* PHP-8.3:
  Fix phpGH-16473: dom_import_simplexml stub is wrong
  • Loading branch information
nielsdos committed Oct 17, 2024
2 parents d8e5166 + c26d5f2 commit 55266d4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PHP NEWS
(nielsdos)
. Fixed bug GH-16336 (Attribute intern document mismanagement). (nielsdos)
. Fixed bug GH-16338 (Null-dereference in ext/dom/node.c). (nielsdos)
. Fixed bug GH-16473 (dom_import_simplexml stub is wrong). (nielsdos)

- EXIF:
. Fixed bug GH-16409 (Segfault in exif_thumbnail when not dealing with a
Expand Down
4 changes: 2 additions & 2 deletions ext/dom/php_dom.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ public static function quote(string $str): string {}
}
#endif

function dom_import_simplexml(object $node): DOMElement {}
function dom_import_simplexml(object $node): DOMAttr|DOMElement {}
}

namespace Dom
Expand Down Expand Up @@ -2168,5 +2168,5 @@ public static function quote(string $str): string {}
}
#endif

function import_simplexml(object $node): Element {}
function import_simplexml(object $node): Attr|Element {}
}
6 changes: 3 additions & 3 deletions ext/dom/php_dom_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions ext/dom/tests/gh16473.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--TEST--
GH-16473 (dom_import_simplexml stub is wrong)
--EXTENSIONS--
dom
simplexml
--FILE--
<?php
$root = simplexml_load_string('<root xmlns:x="urn:x" x:attr="foo"/>');
$attr = $root->attributes('urn:x');
var_dump(dom_import_simplexml($attr)->textContent);
?>
--EXPECT--
string(3) "foo"

0 comments on commit 55266d4

Please sign in to comment.