3v4l.org

run code in 500+ PHP versions simultaneously
<?php class AbstractDomainObject { private $private; protected $protected; } class Entity extends AbstractDomainObject { public function propertyExists(string $propertyName): bool { return property_exists($this, $propertyName); } } var_dump((new Entity())->propertyExists('private')); var_dump((new Entity())->propertyExists('protected'));

preferences:
22.15 ms | 484 KiB | 6 Q