--TEST-- ReflectionProperty::getValue() on typed static property --FILE-- getValue()); $rp = new ReflectionProperty('Test', 'y'); try { var_dump($rp->getValue()); } catch (Error $e) { echo $e->getMessage(), "\n"; } $rp->setValue("24"); var_dump($rp->getValue()); try { $rp->setValue("foo"); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } var_dump($rp->getValue()); Test::$z =& Test::$y; $rp = new ReflectionProperty('Test', 'z'); try { $rp->setValue("foo"); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } var_dump($rp->getValue()); ?> --EXPECT-- int(42) Typed static property Test::$y must not be accessed before initialization int(24) Typed property Test::$y must be int, string used int(24) Cannot assign string to reference held by property Test::$y of type int int(24)