Re: Annotation RFC + Patch

From: Date: Thu, 26 Aug 2010 04:33:39 +0000
Subject: Re: Annotation RFC + Patch
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-49534@lists.php.net to get a copy of this message
Hi!
When you call getAnnotation('foo') it will just call Foo::__construct(array('value' => 'bar', 'baz' => 'hello world')); So there is no overhead on the execution time even if you have annotations in your code.
But there's a lot of overhead if you use them - as objects are created anew each time - and you can't actually do anything with them (like changing annotation's state) since you create them each time anew. The the question is why have object at all - if it can have no state? Why not just have an array? I see the use case you mention in RFC is ORM mapping - which I guess would do just fine with arrays. Any other use cases that you see that would require something more? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#49534) next »