Hi!
Objects are only instantiated when requested (getAnnotations() or
getAnnotation())
So how this happens - does the class store the text of the annotation?
Or expressions in the call are evaluated and stored, but the object is
not instantiated?
What if I call getAnnotation() repeatedly - are they re-instantiated or
stored somewhere, and if so - where?
2. What is permissible in the arguments of annotation - e.g. can I put any
expression there?
You are allowed to use any scalar value + array + any object that
implements ReflectionAnnotation interface.
By scalar value you mean constant value? Are constants allowed?
3. What<Foo(<Bar>)> actually means and how it is supposed to be parsed?
It would instantiate a class Bar and would pass it as an instance of
Foo that is also being created when doing getAnnotations() or
getAnnotation('Foo')
So when exactly Bar is instantiated - when getAnnotations() is called?
6. Do we need any special support for bytecode caches?
Yes. Every structure which can be annotated now will have a new member
in their C structure which is annotations, this structure is populated
at compile time and store all the metadata information. So if you have
an opcode cache the compilation will not occur, so the annotations
will be NULL. That's why the opcode cache will have to store the
annotations, so that it can be retrieved every time.
This then should be added to the proposal.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php