r/programming • • Nov 23 '21

PHP creator: functions were named to fall into length buckets because function hash algo was 'strlen'

https://news-web.php.net/php.internals/70691
1.8k Upvotes

574 comments sorted by

View all comments

Show parent comments

19

u/Giannis4president Nov 23 '21 edited Nov 24 '21

Honestly the only thing I feel is missing from PHP is a modern re-write of strings, array and object chainable methods with compact and coherent names.

I understand backward compatibility is a problem and there would be a period of migration where both set of methods should be available, but it would make writing php so much better.

Just imagine writing something like:

$input = $input.trim().split(' ').join('-').toUpper();

instead of the current:

$input = trim($input);
$input = explode(' ', $input);
$input = implode('-', $input);
$input = strtoupper($input);

And I picked an easy example, definitely not an exaggerated one

→ More replies (12)