--TEST-- Test ReflectionProperty::isWritable() unrelated object --FILE-- isWritable(null, $obj)); } catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } } test(new A); test(new B); test(new C); test(new D); ?> --EXPECT-- ReflectionException: Given object is not an instance of the class this property was declared in bool(true) bool(true) ReflectionException: Given object is not an instance of the class this property was declared in