Re: Attributes/Annotations Case Study: Drupal

From: Date: Sat, 30 Apr 2016 22:30:20 +0000
Subject: Re: Attributes/Annotations Case Study: Drupal
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-93007@lists.php.net to get a copy of this message
On 30/04/2016 23:14, Stanislav Malyshev wrote:
$def instanceof MyAnnotation; //TRUE
That looks fine, however the problem is that if MyAnnotation is a class, then PHP does not have multiple inheritance, so it's the only class it can be. And given that your class has no methods, $def has no methods either and can not have any semantics besides simple data object.
What would prevent the class from having methods? class MyAnnotation { public $foo; public $bar; public function doStuff() { ... } } I don't see any more need for multiple inheritance here than in any other class definition. -- Rowan Collins [IMSoP]

« previous php.internals (#93007) next »