class Person { protected $name = "John"; } $ref = new ReflectionProperty("Person", "name"); if ($ref->isProtected()) { echo "Property is protected"; } else { echo "Property is not protected"; }In this example, we create a `Person` class with a protected property `name`. Then we create a `ReflectionProperty` object for the property `name` and use the `isProtected` method to determine if it is protected. Package library: PHP Standard Library.