diff --git a/tests/classes/bug63463.phpt b/tests/classes/bug63463.phpt new file mode 100644 index 0000000000000..bb4a1ce194e17 --- /dev/null +++ b/tests/classes/bug63463.phpt @@ -0,0 +1,42 @@ +--TEST-- +Verifies that ReflectionProperty does not cause magic methods to get called when properties are unset +--FILE-- +publicProperty, + $this->protectedProperty, + $this->privateProperty + ); + } + + function __get($name) { + echo 'called __get ' . $name; + } + + function __set($name, $value) { + echo 'called __set ' . $name . ' ' . $value; + } +} + +$t = new Test(); + +foreach (array('publicProperty', 'protectedProperty', 'privateProperty') as $propertyName) { + $prop = new ReflectionProperty('Test', $propertyName); + $prop->setAccessible(true); + echo var_export($prop->getValue($t), true) . "\n"; + $prop->setValue($t, 'value'); +} + +?> +--EXPECTF-- +NULL +NULL +NULL