php-src
php-src copied to clipboard
DOMNode Reflection does not return properties
Description
The following code:
<?php
$c = new ReflectionClass("DOMNode");
$ps = $c->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED);
var_dump(count($ps));
foreach($ps as $p) {
var_dump($p->name);
var_dump($p->getType());
}
Resulted in this output:
int(0)
But I expected this output instead: a list of all properties, as documented in https://www.php.net/manual/en/class.domnode.php
see https://sandbox.onlinephpfunctions.com/
PHP Version
PHP 8.0.12
Operating System
macos
3v4l seems to be down right now, but this does work as of PHP 8.1. The change will not be backported.