php-src icon indicating copy to clipboard operation
php-src copied to clipboard

DOMNode Reflection does not return properties

Open staabm opened this issue 4 years ago • 1 comments

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

staabm avatar Dec 19 '21 07:12 staabm

3v4l seems to be down right now, but this does work as of PHP 8.1. The change will not be backported.

nikic avatar Dec 19 '21 08:12 nikic