On 12/9/23 10:40, David CARLIER wrote:
> On Fri, 8 Dec 2023 at 16:10, Niels Dossche <dossche.ni...@gmail.com> wrote:
> 
>> Hi David
>>
>> On 08/12/2023 10:08, David CARLIER wrote:
>>>     I think these would be great additions to PHP as working with paths
>> and files is a core part of any programming language.
>>>
>>>
>>> Seems like it, is there an argument to be made to, let's say, in the
>> performance side ?
>>
>> A native implementation is going to be faster than an implementation in
>> userspace.
>> However, I don't think that matters because the performance is likely
>> dominated by the I/O you do after constructing a path.
>> You'd need to construct a large number of paths before you notice anything
>> I guess.
>>
>> Cheers
>> Niels
>>
> 
> Very true, so what would be the argument beside having those as "builtins"
> as opposed to external components ?
> 

Mainly for convenience reasons and a correct implementation provided by PHP.
Many functions in PHP are not strictly necessary because they can be 
implemented in userland.
They're only there for convenience reasons. Where to draw the line is difficult.
To me they complement the realpath(), dirname(), basename() functions.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to