I'm trying to understand the PHP ReflectionClass but have some trouble. In the documentation 3 modifiers for classes are listed: implicit abstract, explicit abstract and final with constant values 16, 32 and 64 respectively. What I wonder is how the implicit and explicit abstract modifiers work? When is a PHP class implicit abstract?
I tried to figure it out by trial and error with a few simple classes and interfaces and using the ReflectionClass::getModifiers() method to see what happened, however I do not understand the result of the getModifiers method. Using the following interface the result from getModifiers is int(144):
interface Animal {
public function isYellow();
}
$a = new ReflectionClass("Animal");
var_dump($a->getModifiers());
With the modifier constants being 16, 32 and 64 respectively I don't get how the method can return 144 at all? Have I misunderstood something about how a bitfield works or why am I getting this result?
Aucun commentaire:
Enregistrer un commentaire