# PHP new proposal

- Thread: https://externals.io/message/74595
- Original archive: https://news-web.php.net/php.internals/74595
- Started by JoRrrr Maglione on 2014-05-28T16:53:23+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #74595 — JoRrrr Maglione — 2014-05-28T16:53:23+00:00

URL: https://externals.io/message/74595#74595

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!

---

## #74601 — Andrea Faulds — 2014-05-28T17:47:12+00:00

URL: https://externals.io/message/74595#74601 · In reply to: #74595

> 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/

---

## #74611 — Kris Craig — 2014-05-29T05:45:13+00:00

URL: https://externals.io/message/74595#74611 · In reply to: #74601

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

---

## #74633 — Rowan Lewis — 2014-05-29T15:22:19+00:00

URL: https://externals.io/message/74595#74633 · In reply to: #74611

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.




> > […]
>
> 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

---

## #74653 — Darsstar — 2014-05-30T08:46:15+00:00

URL: https://externals.io/message/74595#74653 · In reply to: #74611

2014-05-29 7:45 GMT+02:00 Kris Craig <kris.craig@gmail.com>:

> > […]
>
> 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

---

## #74659 — Yannick Komotir — 2014-05-30T17:43:02+00:00

URL: https://externals.io/message/74595#74659 · In reply to: #74653

Hi,

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

--
Yannick KOMOTIR
