Hi!

> This idea has been proposed many times in the past and it is actually
> a very good proposal, for array, string or other types.

If we have "$array->foo()", we should also have "class foo extends
array" which allows to override foo() in array. This will require some
serious changes, which need to be RFCed and reviewed and seen if they
can really fit the language properly. Just saying "let's bolt on method
calls on top of arrays" is definitely not very good. Having OO Array
type may be good, if we will be able to figure out suitable design that
will allow the same flexibility and power as regular arrays - though I'm
not sure how to do it now.

> The only reason why it is not yet implemented is the technical
> complexity to do it. We need pseudo objects and the likes, and it is
> really not something easy to do, in an efficient enough way.

I disagree - I do not think we need pseudo-objects. If the only point of
the exercise is to convert a call of array_pop to $array->pop, it's not
worth it. It'd just make the language more messy - you wouldn't know
what -> means anymore.
-- 
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

Reply via email to