# A set of 18 functions/changes to improve PHP core

- Thread: https://externals.io/message/119238
- Original archive: https://news-web.php.net/php.internals/119238
- Started by Thomas Hruska on 2023-01-06T16:01:50+00:00
- Messages: 3
- RFC: Miscellaneous Variable Functions (Inactive) — https://externals.io/rfc/misc_variable_functions.md
- RFC: is_valid_utf8() (Inactive) — https://externals.io/rfc/is_valid_utf8.md
- RFC: 2D Matrix Operations (Inactive) — https://externals.io/rfc/2d_matrix_operations.md
- RFC: gd imageexportpixels() and imageimportpixels() (Inactive) — https://externals.io/rfc/gd_image_export_import_pixels.md
- RFC: Working With Substrings (Inactive) — https://externals.io/rfc/working_with_substrings.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #119238 — Thomas Hruska — 2023-01-06T16:01:50+00:00

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

Pre-implemented as an extension (sort of) w/ a preliminary test suite to 
validate the implementations:

https://github.com/cubiclesoft/php-ext-qolfuncs

I probably violated some coding style guidelines and a few things are 
bound to ruffle some feathers.  Be gentle?  But all input is generally 
useful.


I attempted to sign in with my existing PECL credentials on wiki.php.net 
(user:  cubic) but that didn't work.  Attempting to create a Wiki 
account for my possibly already existing user resulted in two error 
messages:  An empty message box and another message box saying "The user 
could not be created."

Requesting RFC karma for user 'cubic' (cubic@php.net) if possible.  Thanks.

I assume I'll need to create up to 18 separate RFCs unless one RFC is 
somehow fine?  Not sure how this should be divvied up yet.

-- 
Thomas Hruska
CubicleSoft President

CubicleSoft has over 80 original open source projects and counting.
Plus a couple of commercial/retail products.

What software are you looking to build?

---

## #119239 — Christoph M. Becker — 2023-01-06T16:19:32+00:00

URL: https://externals.io/message/119238#119239 · In reply to: #119238

> Pre-implemented as an extension (sort of) w/ a preliminary test suite to
> validate the implementations:
>
> https://github.com/cubiclesoft/php-ext-qolfuncs
>
> I probably violated some coding style guidelines and a few things are
> bound to ruffle some feathers.  Be gentle?  But all input is generally
> useful.

Thank you!  At least some of that looks interesting to me.  I'll try to
have a closer look; maybe filing issues on GH is preferable to
discussing all the details on this ML.

> I attempted to sign in with my existing PECL credentials on wiki.php.net
> (user:  cubic) but that didn't work.  Attempting to create a Wiki
> account for my possibly already existing user resulted in two error
> messages:  An empty message box and another message box saying "The user
> could not be created."
>
> Requesting RFC karma for user 'cubic' (cubic@php.net) if possible.  Thanks.

That is not possible, since you already have a PHP account.  Note that
these are completely separate from PECL accounts (although users usually
have the same nicknames for both accounts).  To log in to the Wiki, you
need your PHP account password.  In case you have it forgotten, use
<https://main.php.net/forgot.php>.

> I assume I'll need to create up to 18 separate RFCs unless one RFC is
> somehow fine?  Not sure how this should be divvied up yet.

Maybe a compromise is in order, and you can split it into a couple of
RFCs.  Maybe not; I haven't checked closely so far.

--
Christoph M. Becker

---

## #119241 — G. P. B. — 2023-01-07T03:37:33+00:00

URL: https://externals.io/message/119238#119241 · In reply to: #119239

> 
>
> > […]
>
> Thank you!  At least some of that looks interesting to me.  I'll try to
> have a closer look; maybe filing issues on GH is preferable to
> discussing all the details on this ML.
>
> > […]
> Thanks.
>
> That is not possible, since you already have a PHP account.  Note that
> these are completely separate from PECL accounts (although users usually
> have the same nicknames for both accounts).  To log in to the Wiki, you
> need your PHP account password.  In case you have it forgotten, use
> <https://main.php.net/forgot.php>.
>
> > […]
>
> Maybe a compromise is in order, and you can split it into a couple of
> RFCs.  Maybe not; I haven't checked closely so far.
>
> --
> Christoph M. Becker
>

I think splitting into "component" RFCs might make more sense as there are
some string, image, 2D matrices, variable and hash things which are logical
delimitations between these function additions.

I've had a cursory read of the README most seem reasonable, I have my
doubts about the matrix functions (see below) and str_realloc() (but that
might just be the naming and how it's meant to be use with str_splice which
is confusing me)

About str_splice(), why not call it str_modify() as the behaviour seems to
be subtly different from its array equivalent `array_splice()`?

About matrices:
We already have a couple of issues supporting them that we probably should
address those first, namely that multiplication is assumed to be
commutative, something which is not true for matrices (see
https://github.com/php/php-src/pull/9218)
Hoping I get back to argue about the former, it would make it possible to
use objects and the fact extensions can overload operators to make dealing
with matrices easier.
This is IMHO a better approach than using multidimensional arrays, which
those functions also seem to limit to the (albeit very useful) 2*2 case.

Anyhow, best of luck with the RFCs.

Best regards,

George P. Banyard
