--TEST-- Test ReflectionProperty::setAccessible(). --SKIPIF-- --FILE-- getValue($instance)); } catch(Exception $exc) { echo $exc->getMessage(), "\n"; } $propInfo->setAccessible(true); var_dump($propInfo->getValue($instance)); $propInfo->setAccessible(false); try { var_dump($propInfo->getValue($instance)); } catch(Exception $exc) { echo $exc->getMessage(), "\n"; } ?> --EXPECTF-- Protected property: Cannot access non-public member TestClass::prot int(4) Cannot access non-public member TestClass::prot