FAQ
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!

Search Discussions

  • Andrea Faulds at May 28, 2014 at 5:47 pm

    On 28 May 2014, at 17:53, JoRrrr Maglione wrote:

    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/
  • Kris Craig at May 29, 2014 at 5:45 am


    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
  • Rowan Lewis at May 29, 2014 at 3:30 pm
    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.

    On Thu, May 29, 2014 at 8:45 AM, Kris Craig wrote:



    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
  • Darsstar at May 30, 2014 at 8:46 am

    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
  • Yannick Komotir at May 30, 2014 at 5:43 pm
    Hi,

    Sara Golemon did similar works https://github.com/sgolemon/objectifier

    --
    Yannick KOMOTIR

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 28, '14 at 4:53p
activeMay 30, '14 at 5:43p
posts6
users6
websitephp.net

People

Translate

site design / logo © 2022 Grokbase