History log of /PHP-8.2/ext/dom/php_dom_arginfo.h (Results 26 – 50 of 76)
Revision Date Author Comments
# 24e5e4ec 08-Oct-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-8996: DOMNode serialization on PHP ^8.1

PHP 8.1 introduced a seemingly unintentional BC break in ca94d55a19 by
blocking the (un)serialization of DOM objects.
This was done bec

Fix GH-8996: DOMNode serialization on PHP ^8.1

PHP 8.1 introduced a seemingly unintentional BC break in ca94d55a19 by
blocking the (un)serialization of DOM objects.
This was done because the serialization never really worked and just
resulted in an empty object, which upon unserialization just resulted in
an object that you can't use.

Users can however implement their own serialization methods, but the
commit made that impossible as the ACC flag gets passed down to the
child class. An approach was tried in #10307 with a new ACC flag to
selectively allow serialization with subclasses if they implement the
right methods. However, that was found to be too ad hoc.

Instead, let's abuse how the __sleep and __wakeup methods work to throw
the exception instead. If the child class implements the __serialize /
__unserialize method, then the throwing methods won't be called.
Similarly, if the child class implements __sleep and __wakeup, then
they're overridden and it doesn't matter that they throw.

For the user, this PR has the exact same behaviour for (sub)classes that
don't implement the serialization methods: an exception will be thrown.
For code that previously implemented subclasses with these methods, this
approach will make that code work again. This approach should be both BC
preserving and unbreak user's code.

Closes GH-12388.

For the test:
Co-authored-by: wazelin <contact@sergeimikhailov.com>

show more ...


# 6e468bbd 31-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix json_encode result on DOMDocument

According to https://www.php.net/manual/en/class.domdocument:
When using json_encode() on a DOMDocument object the result will be
that of en

Fix json_encode result on DOMDocument

According to https://www.php.net/manual/en/class.domdocument:
When using json_encode() on a DOMDocument object the result will be
that of encoding an empty object.

But this was broken in 8.1. The output was `{"config": null}`.
That's because the config property is defined with a default value of
NULL, hence it was included. The other properties are not included
because they don't have a default property, and nothing is ever written
to their backing field. Hence, the JSON encoder excludes them.
Similarly, `(array) $doc` would yield the same `config` key in the
array.

Closes GH-11840.

show more ...


# ef4f0883 04-Jul-2023 Ilija Tovilo

Revert "Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs"

This reverts commit d7ab0ff0c81bf672c3d4ac73e1b2cbd158296eef.


# d7ab0ff0 03-Jul-2023 Máté Kocsis

Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs


# 761b9a44 29-May-2023 divinity76

Fix return value in stub file for DOMNodeList::item

Not explicitly documenting the possibility of returning DOMElement causes
the Intelephense linter (a popular PHP linter with ~9 millio

Fix return value in stub file for DOMNodeList::item

Not explicitly documenting the possibility of returning DOMElement causes
the Intelephense linter (a popular PHP linter with ~9 million downloads:
https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client)
to think this code is bad:

$xp->query("whatever")->item(0)->getAttribute("foo");

DOMNode does not have getAttribute (while DOMElement does).
Documenting the DOMElement return type should fix Intelephense's linter.

Closes GH-11342.

show more ...


# b4ec3e9b 28-Aug-2022 Máté Kocsis

Do not generate CONST_CS when registering constants (#9439)


# e328c683 19-Jul-2022 Máté Kocsis

Rename @cname to @cvalue in stubs (#9043)

@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as

Rename @cname to @cvalue in stubs (#9043)

@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.

show more ...


# 5cf2659f 20-Jun-2022 Yurun

Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815)


# 1bcd8d39 08-Jun-2022 Pierrick Charron

Update gen_stub to support #if around classes


# 6fd2b393 13-Jun-2022 Pierrick Charron

Indent with TAB in .h files generated by gen_stub


# debd38f8 02-Jun-2022 Máté Kocsis

Add support for sensitive parameters in stubs


# 9c446a93 01-Jun-2022 Máté Kocsis

Declare ext/dom constants in stubs (#8676)


# 84cd2a90 25-May-2022 Máté Kocsis

Add some stub related todo comments


# 14da1cb90 22-May-2022 Máté Kocsis

Add support for class constants in stubs (#7434)


# 8168d312 08-Sep-2021 Máté Kocsis

Fix a few more classsynopsis generation issues

Closes GH-7480


# 25cbd084 26-Aug-2021 Máté Kocsis

Make a few unuseful DOMEntity properties readonly (#7406)


# cdf2f3eb 25-Aug-2021 Máté Kocsis

DOMCharacterData::$data and DOMAttr::$value are writable


# ca94d55a 10-Aug-2021 Nikita Popov

Mark DOM classes as not serializable


# da2cd931 05-Aug-2021 Máté Kocsis

Fix another DOMNameSpaceNode casing issue


# ee11a606 05-Aug-2021 Máté Kocsis

Fix DOMNameSpaceNode casing


# 23b1c4a9 22-Jul-2021 Máté Kocsis

Migrate to PHP-Parser 4.12.0 and regenerate some arginfos


# a0893865 21-Jul-2021 Nikita Popov

dom_import_simplexml() cannot return null


# 1602db2d 21-Jul-2021 Nikita Popov

Fix return type of DOMNodeList::item()

It can also return DOMNameSpaceNode :(


# d9838e54 20-Jul-2021 Máté Kocsis

Declare tentative return types for ext/dom (#6985)


# c2a58ab0 26-May-2021 Nikita Popov

Throw DomException for DOM out-of-memory error conditions

A number of error conditions in DOM can only occur if libxml2 runs
out of memory, at least as far as I can see. In such cases we

Throw DomException for DOM out-of-memory error conditions

A number of error conditions in DOM can only occur if libxml2 runs
out of memory, at least as far as I can see. In such cases we
currently do a silent "return false", which violates the DOM spec,
and which code is very unlikely to handle sensibly.

Switch these to throw a DomException with INVALID_STATE_ERR type.
This error type is chosen because we use for similar checks
elsewhere, for example:
https://github.com/php/php-src/blob/a733b1ada7895f6fa5e349755a878cae9189e3f5/ext/dom/documentfragment.c#L45-L48

This changes some of the more obvious cases I spotted, but there are probably more.

Closes GH-7049.

show more ...


1234