1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00

Merge branch 'PHP-7.4'

* PHP-7.4:
  Revert "Fix #79065: DOM classes do not expose properties to Reflection"
This commit is contained in:
Nikita Popov
2020-04-28 15:10:23 +02:00
2 changed files with 0 additions and 53 deletions

View File

@@ -385,28 +385,6 @@ static int dom_property_exists(zend_object *object, zend_string *name, int check
}
/* }}} */
/* {{{ dom_get_properties */
static HashTable *dom_get_properties(zend_object *object)
{
dom_object *obj = php_dom_obj_from_obj(object);
HashTable *props = zend_std_get_properties(object);
if (obj->prop_handler != NULL) {
zend_string *key;
dom_prop_handler *hnd;
ZEND_HASH_FOREACH_STR_KEY_PTR(obj->prop_handler, key, hnd) {
zval val;
if (hnd->read_func(obj, &val) == SUCCESS) {
zend_hash_update(props, key, &val);
}
} ZEND_HASH_FOREACH_END();
}
return props;
}
/* }}} */
static HashTable* dom_get_debug_info_helper(zend_object *object, int *is_temp) /* {{{ */
{
dom_object *obj = php_dom_obj_from_obj(object);
@@ -590,7 +568,6 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
dom_object_handlers.has_property = dom_property_exists;
dom_object_handlers.get_properties = dom_get_properties;
dom_object_handlers.get_debug_info = dom_get_debug_info;
memcpy(&dom_nnodemap_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers));

View File

@@ -1,30 +0,0 @@
--TEST--
Bug #79065 (DOM classes do not expose properties to Reflection)
--SKIPIF--
<?php
if (!extension_loaded('dom')) die('skip dom extension not available');
?>
--FILE--
<?php
$dom = new DOMDocument;
$dom->loadHTML('<b>test</b>');
var_dump(count(get_object_vars($dom)));
$ro = new ReflectionObject($dom);
var_dump(count($ro->getProperties()));
var_dump($ro->hasProperty("textContent"));
$rp = $ro->getProperty("textContent");
var_dump($rp);
var_dump($rp->getValue($dom));
?>
--EXPECTF--
int(38)
int(38)
bool(true)
object(ReflectionProperty)#%d (2) {
["name"]=>
string(11) "textContent"
["class"]=>
string(11) "DOMDocument"
}
string(4) "test"