From: Christoph M. Becker Date: Wed, 24 Jun 2020 09:19:17 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbce0cbacbbe264878a2eedf945460929b9a2b72;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fix #69804: ::getStaticPropertyValue() throws on protected props --- cbce0cbacbbe264878a2eedf945460929b9a2b72 diff --cc ext/reflection/php_reflection.c index 2208b76aa9,c3c29d880b..8f0e22dd04 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@@ -3930,10 -3811,10 +3930,10 @@@ ZEND_METHOD(ReflectionClass, getStaticP /* {{{ proto public mixed ReflectionClass::getStaticPropertyValue(string name [, mixed default]) Returns the value of a static property */ -ZEND_METHOD(reflection_class, getStaticPropertyValue) +ZEND_METHOD(ReflectionClass, getStaticPropertyValue) { reflection_object *intern; - zend_class_entry *ce; + zend_class_entry *ce, *old_scope; zend_string *name; zval *prop, *def_value = NULL; @@@ -3963,10 -3849,10 +3968,10 @@@ /* {{{ proto public void ReflectionClass::setStaticPropertyValue(string $name, mixed $value) Sets the value of a static property */ -ZEND_METHOD(reflection_class, setStaticPropertyValue) +ZEND_METHOD(ReflectionClass, setStaticPropertyValue) { reflection_object *intern; - zend_class_entry *ce; + zend_class_entry *ce, *old_scope; zend_property_info *prop_info; zend_string *name; zval *variable_ptr, *value; diff --cc ext/reflection/tests/006.phpt index c21aa5af8b,0e33e0a6a1..2b03f3e694 --- a/ext/reflection/tests/006.phpt +++ b/ext/reflection/tests/006.phpt @@@ -94,7 -112,4 +110,3 @@@ string(7) "updated string(7) "updated" string(7) "updated" string(7) "updated" - EXCEPTION - EXCEPTION -===DONE=== diff --cc ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt index b11d2ec0d7,c63ee330d4..2b4cd27a94 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt @@@ -34,17 -33,17 +33,17 @@@ var_dump($rcB->getStaticPropertyValue(" echo "\nRetrieving non-existent values from A with no default value:\n"; try { - var_dump($rcA->getStaticPropertyValue("protectedOverridden")); + var_dump($rcA->getStaticPropertyValue("protectedDoesNotExist")); - echo "you should not see this"; + echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { - var_dump($rcA->getStaticPropertyValue("privateOverridden")); + var_dump($rcA->getStaticPropertyValue("privateDoesNotExist")); - echo "you should not see this"; + echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?> diff --cc ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt index f51f4136b1,41a6482f66..1414cfadb7 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt @@@ -35,17 -35,17 +35,17 @@@ print_r($rcB->getStaticProperties()) echo "\nSet non-existent values from A with no default value:\n"; try { - var_dump($rcA->setStaticPropertyValue("protectedOverridden", "new value 8")); + var_dump($rcA->setStaticPropertyValue("protectedDoesNotExist", "new value 8")); - echo "you should not see this"; + echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } try { - var_dump($rcA->setStaticPropertyValue("privateOverridden", "new value 9")); + var_dump($rcA->setStaticPropertyValue("privateDoesNotExist", "new value 9")); - echo "you should not see this"; + echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e->getMessage() . "\n"; } ?>