<?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'));
You have javascript disabled. You will not be able to edit any code.