[php-src] Issue #8831: Optional classes for primitive manipulation functions
| From: | longshadowdev | Date: | Mon, 20 Jun 2022 02:15:13 +0000 |
| Subject: | [php-src] Issue #8831: Optional classes for primitive manipulation functions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241765@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8831
Author: longshadowdev
### Description
I'm not sure if this has been brought up before. It seems very obvious so probably has, in
which case please point me to previous discussion and let me know if it's something that would
be 'rejected' if I contributed it myself.
PHP has come a long way to be object orientated, but we still rely on very outdated procedural
function calls for String, Array, Integer (etc) manipulation.
If we wanted to avoid having optional object orientated objects, we could at least have static
classes?
For example instead of str_contains (a new function in php8 with legacy conventions) why not have
String::contains()?
Then backport all of the similar functions into methods of this new class, and maybe eventually in a
later version of php make the legacy functions optional as a compile time or runtime flag.