My "primary" language is Java so I wondered if a thing similar to overloading methods is possible in php? For example can I have 2 constructors in a class provided that they have different signature?
And speaking of that can I define signature for a function e.g. function someFunction(string $name){....}?
The PHP API is not as comprehensive as JAVA's but it is kind of fun to zip around in. Some of the best information comes out of the user comments, where they talk about overloading a little. http://www.php.net/manual/sv/language.oop.php
I don't remember where I read it, but somewhere in the docs (I think) the point was made that PHP does not try to be a true 'OO' language, just that they provide some OO support. There is an overload() function, but I think it is pretty immature and I have never played with it at all. http://www.php.net/manual/en/printwn/ref.overload.php
:mad: so classes are lil more then arrays with -> instead of []? 🙁
Is it possible to make a subclass that would have different constructor, but use methods of parentclass? Or will that bring out more "surprises" about "OO" a'la php?