@noiob A lot of the php stdlib functions have the same history: "PHP is almost perfect, but I need a function that behaves exactly like XYZ from language ABC does for my use case. Could you add it?"
Thus, the function was copied - name and parameters included, of course, since the requester already knew that one.
@Denian most languages I've used call them split()
and join()
@noiob I might be misremembering the specifics, though, since I encountered that one about 8 years ago.
@Denian hm, maybe they wanted to avoid confusion with str_split()
; join()
is an alias for implode()
at least
@noiob Possible. Also, double check your "best practices". I was always told to use "empty" instead of manually checking for null etc. - use it in a sufficiently large loop and use a profiler and you find out that empty has a lot of overhead.
@noiob If you want to have some real fun, I vaguely recall that there was a funny effect when parsing and formatting dates. There's an object oriented set of methods and a set of procedural functions, and the way I recall it, they use two different ways to specify the format... with the object oriented parser matching the procedural formatter and vice versa. You can just imagine the history behind that one.