From e7c1e4b7d23b9d00a1f9e475836e671881be32de Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 8 Nov 2012 07:18:15 +0100 Subject: [PATCH] Adding bug 63463 (https://bugs.php.net/bug.php?id=63463) test --- tests/classes/bug63463.phpt | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/classes/bug63463.phpt 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