Tuesday, May 19, 2009

@var magic comment

This is a good example how people get used to a bad habits. @var magic comment has appeared first in early Zend Studio, and this is how it was used:



As you can see this magic comment makes content assist know what is the type of $test variable. With PDT 2.0 we have canceled this behaviour due to promising type inference engine, that can resolve variable back to the place where it was declared. For example:




As it turned out later this is not enough for most PHP developers as there are many cases where there's no reference from variable usage to its declaration (if declaration exists at all). One example has changed our mind, and we've decided to fix 260805, 249705 and 257481 ASAP.
One famous MVC framework magically allows to refer to View members from within .phtml script using $this variable. To support this you definitely need something to tell content assist that $this variable is actually an instance of some class even though it appears in a global scope...
Ouch... PHP is full of magic :)

PS: @var comment fixes are available in 2.1.0M7, but I suggest using latest integration build.

5 comments:

matipl said...

@var works well in NetBeans 6.5 (with PHP)

mweierophinney said...

Just a quick note: While Zend_View does this, Zend_View is a sibling/ancestor of Savant 2/3 and Solar_View -- in other words, we're not the only code on the block doing this. :)

Kathy Smith said...

Hello my name is Kathy Smith and i want to testify about the powerful magical mirror that helped my life in positive ways and that blessed me. I have been hearing about this magical mirror for long and i have been searching for a way to get it but to no avail all my efforts seemed to be in vain but my cousin's friend told me how she ordered for the magical mirror from Dada Magical a powerful man from Africa and how she used it and how she became blessed. At first i thought it was a joke but i decided to order for it by contacting Magicalmirrorofgoodness@yahoo.com and i got it. To my greatest surprise, the mirror was even better than what i expected. The magical mirror is really a good one and it worked and it is still with me and it is still working. The magical mirror is HARMLESS and it is not scaring. it tells me what to do and what not to do, it reveals deep secret to me, it protect me and it tells me who is against me and who is my true friend. It suggest good ideas for me and it has made me rich too and in fact the magical mirror is a solution because is provide and can tell you solution to your problems. Am so excited and am so endowed and blessed to have the magical mirror with me. This magical mirror helps protect against evil. This is real and you can get it and see for your self so if you need the magical mirror don't hesitate to get it and you can get it by contacting Magicalmirrorofgoodness@yahoo.com

Hello my name is Kathy Smith and i want to testify about the powerful magical mirror that helped my life in positive ways and that blessed me. I have been hearing about this magical mirror for long and i have been searching for a way to get it but to no avail all my efforts seemed to be in vain but my cousin's friend told me how she ordered for the magical mirror from Dada Magical a powerful man from Africa and how she used it and how she became blessed. At first i thought it was a joke but i decided to order for it by contacting Magicalmirrorofgoodness@yahoo.com and i got it. To my greatest surprise, the mirror was even better than what i expected. The magical mirror is really a good one and it worked and it is still with me and it is still working. The magical mirror is HARMLESS and it is not scaring. it tells me what to do and what not to do, it reveals deep secret to me, it protect me and it tells me who is against me and who is my true friend. It suggest good ideas for me and it has made me rich too and in fact the magical mirror is a solution because is provide and can tell you solution to your problems. Am so excited and am so endowed and blessed to have the magical mirror with me. This magical mirror helps protect against evil. This is real and you can get it and see for your self so if you need the magical mirror don't hesitate to get it and you can get it by contacting Magicalmirrorofgoodness@yahoo.com

Kathy Smith said...

Hello my name is Kathy Smith and i want to testify about the powerful magical mirror that helped my life in positive ways and that blessed me. I have been hearing about this magical mirror for long and i have been searching for a way to get it but to no avail all my efforts seemed to be in vain but my cousin's friend told me how she ordered for the magical mirror from Dada Magical a powerful man from Africa and how she used it and how she became blessed. At first i thought it was a joke but i decided to order for it by contacting Magicalmirrorofgoodness@yahoo.com and i got it. To my greatest surprise, the mirror was even better than what i expected. The magical mirror is really a good one and it worked and it is still with me and it is still working. The magical mirror is HARMLESS and it is not scaring. it tells me what to do and what not to do, it reveals deep secret to me, it protect me and it tells me who is against me and who is my true friend. It suggest good ideas for me and it has made me rich too and in fact the magical mirror is a solution because is provide and can tell you solution to your problems. Am so excited and am so endowed and blessed to have the magical mirror with me. This magical mirror helps protect against evil. This is real and you can get it and see for your self so if you need the magical mirror don't hesitate to get it and you can get it by contacting Magicalmirrorofgoodness@yahoo.com

Hello my name is Kathy Smith and i want to testify about the powerful magical mirror that helped my life in positive ways and that blessed me. I have been hearing about this magical mirror for long and i have been searching for a way to get it but to no avail all my efforts seemed to be in vain but my cousin's friend told me how she ordered for the magical mirror from Dada Magical a powerful man from Africa and how she used it and how she became blessed. At first i thought it was a joke but i decided to order for it by contacting Magicalmirrorofgoodness@yahoo.com and i got it. To my greatest surprise, the mirror was even better than what i expected. The magical mirror is really a good one and it worked and it is still with me and it is still working. The magical mirror is HARMLESS and it is not scaring. it tells me what to do and what not to do, it reveals deep secret to me, it protect me and it tells me who is against me and who is my true friend. It suggest good ideas for me and it has made me rich too and in fact the magical mirror is a solution because is provide and can tell you solution to your problems. Am so excited and am so endowed and blessed to have the magical mirror with me. This magical mirror helps protect against evil. This is real and you can get it and see for your self so if you need the magical mirror don't hesitate to get it and you can get it by contacting Magicalmirrorofgoodness@yahoo.com

Kathy Smith said...

Hello my name is Kathy Smith and i want to testify about the powerful magical mirror that helped my life in positive ways and that blessed me. I have been hearing about this magical mirror for long and i have been searching for a way to get it but to no avail all my efforts seemed to be in vain but my cousin's friend told me how she ordered for the magical mirror from Dada Magical a powerful man from Africa and how she used it and how she became blessed. At first i thought it was a joke but i decided to order for it by contacting Magicalmirrorofgoodness@yahoo.com and i got it. To my greatest surprise, the mirror was even better than what i expected. The magical mirror is really a good one and it worked and it is still with me and it is still working. The magical mirror is HARMLESS and it is not scaring. it tells me what to do and what not to do, it reveals deep secret to me, it protect me and it tells me who is against me and who is my true friend. It suggest good ideas for me and it has made me rich too and in fact the magical mirror is a solution because is provide and can tell you solution to your problems. Am so excited and am so endowed and blessed to have the magical mirror with me. This magical mirror helps protect against evil. This is real and you can get it and see for your self so if you need the magical mirror don't hesitate to get it and you can get it by contacting Magicalmirrorofgoodness@yahoo.com