Intellisense idea (again)
Posted: November 30th, 2012, 5:26 pm
Hey,
I was thinking about intellisense. Right now, in our projects (a lot of files) we have a lot of collection classes, whose base class implements Iterator interface. If/when you do foreach loops to search for such interface and infer the item type, there will be one problem: I know for a fact that PHP punishes severly performance-wise for every function entry and more for every class method entry. So, if we want to take advantage of that feature, we would have to override all the members of the interface in every inheriting class, because it has different item type, which might kill us instantly.
I was wondering, maybe we can come up with some comment syntax in the inheriting classes, for example
/*
* @implements Iterator<COrder>
*/
or
/*
* @implements Iterator of COrder
*/
I know that .NET-wise overriding is the way to go, but adding an additional method call (even with empty body) for thousands of operations will add significant overhead (welcome to the PHP world).
Please, everyone, feel free to share your thoughts too.
So, Jakub, Miloslav?
I was thinking about intellisense. Right now, in our projects (a lot of files) we have a lot of collection classes, whose base class implements Iterator interface. If/when you do foreach loops to search for such interface and infer the item type, there will be one problem: I know for a fact that PHP punishes severly performance-wise for every function entry and more for every class method entry. So, if we want to take advantage of that feature, we would have to override all the members of the interface in every inheriting class, because it has different item type, which might kill us instantly.
I was wondering, maybe we can come up with some comment syntax in the inheriting classes, for example
/*
* @implements Iterator<COrder>
*/
or
/*
* @implements Iterator of COrder
*/
I know that .NET-wise overriding is the way to go, but adding an additional method call (even with empty body) for thousands of operations will add significant overhead (welcome to the PHP world).
Please, everyone, feel free to share your thoughts too.
So, Jakub, Miloslav?