I don't think so, it's a feature of the language. But I think it would be better to extend the class that you want to alter, this would be the cleanest and most flexible way to do that, since MyFoo extending the Foo class and sharing the same underlying structure.
yes I agree with the extend solution, but I am in a particular case where I cannot really use it
So i think about this walkaround, but I didn't really know if it's ok or really bad
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't think so, it's a feature of the language. But I think it would be better to extend the class that you want to alter, this would be the cleanest and most flexible way to do that, since MyFoo extending the Foo class and sharing the same underlying structure.
yes I agree with the extend solution, but I am in a particular case where I cannot really use it
So i think about this walkaround, but I didn't really know if it's ok or really bad