History log of /PHP-8.1/ext/dom/php_dom_arginfo.h (Results 1 – 25 of 42)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 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 ...


# 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 ...


Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0, php-7.3.33, php-7.3.32, php-7.3.31
# 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

Revision tags: php-7.3.30
# ca94d55a 10-Aug-2021 Nikita Popov

Mark DOM classes as not serializable

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

Fix another DOMNameSpaceNode casing issue

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

Migrate to PHP-Parser 4.12.0 and regenerate some arginfos

# 239446c5 21-Jul-2021 Nikita Popov

Merge branch 'PHP-8.0'

* PHP-8.0:
dom_import_simplexml() cannot return null


# 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)

Revision tags: php-7.3.29
# 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 ...

# b9893c2a 16-Jul-2021 Nikita Popov

Actually add the tentative type marker...

# cad6144d 16-Jul-2021 Nikita Popov

Add minimial tentative types to dom

Just for implementations of Countable. These (no longer) suffer
from an overly broad return type.

# 4cf0269e 16-Jul-2021 Nikita Popov

DOMNamedNodeMap::count() cannot return false

# f089e8af 16-Jul-2021 Nikita Popov

DOMNodeList::count() cannot return false

Refactor the implementation to make this obvious, and make use
of early returns.

# 7da2151f 19-May-2021 Máté Kocsis

Declare typed properties in ext/dom

Closes GH-7013

Revision tags: php-7.3.28, php-7.3.27
# a5e938dc 26-Jan-2021 Máté Kocsis

Declare dynamic properties in ext/dom

Closes GH-6644

# bf0f6aaf 15-Feb-2021 Máté Kocsis

Improve class entry generation

Related to GH-6701

# 45fa7596 09-Feb-2021 Máté Kocsis

Add missing classes to stubs

# 99b08ac2 08-Feb-2021 Máté Kocsis

Implicitly enable function entry generation when class entry generation is enabled

Closes GH-6675

# e32d5e8f 09-Feb-2021 Nikita Popov

Merge branch 'PHP-8.0'

* PHP-8.0:
Make createDocument() $namespace nullable


# 3549f48e 09-Feb-2021 Nikita Popov

Make createDocument() $namespace nullable

According to the DOM specification, this argument should be
nullable. It's also supposed to be a required argument, but
not changing that at

Make createDocument() $namespace nullable

According to the DOM specification, this argument should be
nullable. It's also supposed to be a required argument, but
not changing that at this point.

show more ...

12