/* {{{ 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;
/* {{{ 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;
string(7) "updated"
string(7) "updated"
string(7) "updated"
- EXCEPTION
- EXCEPTION
-===DONE===
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";
}
?>
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";
}
?>