PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
If I have a class 'b' that extends a class 'a', and both classes define a function 'foo', how can I invoke a's definition of foo on an instance of b? Ie:
I don't remember that working in C++... at any rate, that's VERY bad object form if you want that. You'll need a fascade function in B to proxy into A for an outsider..
It works in C++, but I agree that it's not good coding. I don't actually want to use it, I was just learning PHP classes and wanted to make sure I understood fully. Thanks.
from what I remember, A would have to be a member of B, not a parent for it to work... although it's been a few years since I last worked in C++... (at least, your code specifically)