--TEST-- Test ReflectionProperty::setValue() error cases. --FILE-- setValue($instance, "NewValue"); var_dump($propInfo->getValue($instance)); echo "\n\nInstance without property:\n"; $propInfo = new ReflectionProperty('TestClass', 'pub2'); var_dump($propInfo->setValue($instanceWithNoProperties, "NewValue")); var_dump($instanceWithNoProperties->pub2); ?> --EXPECT-- Protected property: string(8) "NewValue" Instance without property: NULL string(8) "NewValue"