Hi!
it's the same as for the current argument type hinting. you can access that information via Reflection http://hu2.php.net/manual/en/reflectionparameter.getclass.php
Really? That's how you write your code - do a reflection check before every call? Nobody does that.
why did we added ppp if people can define in the documentation(or in the method name :/) that which method is public and which isn't
Well, this is a good argument, PPP case seems close. Still, PPP is not really as dynamic as variable types are - PPP picture is much simpler and it also serves the call target, not the caller - i.e., the caller does not rely on pretty much anything in PPP, while the target relies on its protected functions not being called by strangers. So my main objection is that return typing doesn't actually serve the caller. Also, the fact that for PHP is extremely common to return null/false from methods on error makes a big hole in this concept even if we accepted the return typing as a counterpart to existing argument typing. E.g., seeing something like:
function (Foo|Bar|false|null) ugly() makes me fill dizzy. This doesn't look like something we'd want. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php