On Mon, Jul 16, 2012 at 7:27 PM, Andrew Faulds <ajf...@googlemail.com> wrote: > Through its history, PHP has slowly become more object-oriented.
While PHP has become more capable for OOP, it has also become more capable for FP, too. And, procedural programming is still a very strong influence. > I think PHP could benefit from making arrays, strings, integers, > floats, and possibly booleans, into "pseudo-objects". By this I mean > that they are not really objects (they are still primitive types and > keep their passing semantics), but they have methods. For instance, > instead of array_keys($array), one could do $array->keys(); If the pseudo objects keep their passing semantics, this could be a source of confusion. > Adding this would make PHP feel more modern and allow people to > embrace more object-oriented programming styles. As a bonus, it would > also give a chance to make the string/array/etc functions better and > more consistently named and possibly implemented. I'm not sure I would classify it as more modern or if we should be hoping more people embrace OOP. The language would feel more OO with these changes, but there are many programming paradigms that are are trending now (FP, AOP, DbC, homoiconic languages like Clojure, Lisp, and Julia have helped promote meta-programming, etc.) I like that fact that PHP falls back into a procedural paradigm nicely, whilst still allowing me to use OOP design patterns and FP techniques for the bulk of my applications. While I'd like to see more consistency within the core functions, I'm not sure this is the route to take. Adam -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php