Hello. I like programming in PHP, and I've made some abstract classes called "Strings", "Math", "Array" which group all the functions refering to their data type.My idea is creating classes like "Strings", "Math", "Arrays" which should be abstract and have static methods, for example:All functions about strings should be inside "Strings Class" the same for "Math" and "Arrays".
I would like these classes to be part of PHP core.Hope you understand what I'm saying.!
Thanks!
Hello. I like programming in PHP, and I've made some abstract classes called "Strings", "Math", "Array" which group all the functions refering to their data type.My idea is creating classes like "Strings", "Math", "Arrays" which should be abstract and have static methods, for example:All functions about strings should be inside "Strings Class" the same for "Math" and "Arrays".
I would like these classes to be part of PHP core.Hope you understand what I'm saying.!
A similar but different idea has already been proposed, namely methods on scalars and arrays, which is Nikita Popov's (aka nikic) idea.
--
Andrea Faulds
http://ajf.me/
A similar but different idea has already been proposed, namely methods on
scalars and arrays, which is Nikita Popov's (aka nikic) idea.
Do you know if there's an RFC for that one? I vaguely remember reading
something about it but I didn't see it on a quick scan of the RFC page.
--Kris
I don't think there's an RFC, but Nikita wrote at length about it and
created a PHP extension to allow for users to define their own methods on
primitive types:
http://nikic.github.io/2014/03/14/Methods-on-primitive-types-in-PHP.html
This work was then used by Ross Riley who has attempted to define what
these methods should be:
https://github.com/rossriley/php-scalar-objects
Hope this helps.
A similar but different idea has already been proposed, namely methods on
scalars and arrays, which is Nikita Popov's (aka nikic) idea.Do you know if there's an RFC for that one? I vaguely remember reading
something about it but I didn't see it on a quick scan of the RFC page.--Kris
2014-05-29 7:45 GMT+02:00 Kris Craig kris.craig@gmail.com:
A similar but different idea has already been proposed, namely methods on
scalars and arrays, which is Nikita Popov's (aka nikic) idea.Do you know if there's an RFC for that one? I vaguely remember reading
something about it but I didn't see it on a quick scan of the RFC page.--Kris
There is https://wiki.php.net/rfc/autoboxing