Yasuo Ohgaki wrote on 05/03/2015 09:24:
I would love to have new OO APIs for variables. I also like to write
procedural
code for simple scripts. Therefore, even if we have new OO APIs, I
would like to
improve/maintain procedural functions and make them not legacy functions.
I don't see scalar methods primarily as a way to make PHP more OO (it's
just syntax sugar, at the end of the day), but as an opportunity to
bring in a new API with real advantages.
As Jordi says in the other thread, there are other things you could
improve about the array functions beyond making the argument order match
the string functions. If you were to sit down and design a new set of
array functions (for instance), which were a valuable replacement for
the old ones, you wouldn't also need to add dozens of aliases to the old
set, because your new set could have a consistent and intuitive naming
and behaviour convention.
Scalar methods are just one way of designing that new set of functions,
but you could just make a namespace of completely redesigned functions,
with deliberately new names to make it obvious which set was being used.
At that point, having the aliases you're proposing would be actively
harmful, because now users would have to ask (themselves/the
manual/Stack Overflow) "is this the new function, or just the new name
for the old function?"
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php