Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121974 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54065 invoked from network); 9 Dec 2023 16:21:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Dec 2023 16:21:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D56CA180003 for ; Sat, 9 Dec 2023 08:21:19 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 9 Dec 2023 08:21:19 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-54cc60f3613so4007582a12.2 for ; Sat, 09 Dec 2023 08:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702138863; x=1702743663; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nloSX+ggW8/n5KGUgW0eYHGU/j6FgNCm+1qt0vJifIA=; b=YK2LVM2MWdqoTtIMFllxdeVY8XMtOrkAn3c6xGjvHtJ849m4x/AmCzomaEQ1aFIOq8 VDAftEvy4GSCdzUXoQTjZvpNe4i+41ghCVyoXuPNeM+KvvoRUtrHyFeTZOXT/4N5eedJ iTUcWXieJHXkKev0FtYOSQZRNG6urmPUc0ZKOAJg/2fZlKmHC0Yw4NOckKWs8/qsduLx +Ov29CFJzQaxEBXNWPrCA/+p+pNVWVSNBZvSVDihxiH+b/tHbDq3d7FXOzx9P8YsvTBe 2mv0mk95A9ft2Ig33uaPCjgNynGUvBEhm4Sdcx2lb3yx+Zj+DSrhSBEm5CcycbbYjOLR Syrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702138863; x=1702743663; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nloSX+ggW8/n5KGUgW0eYHGU/j6FgNCm+1qt0vJifIA=; b=PfWLPfNdN7vStlb2DG5a8WNOtu+C+pIu74GwvoR77idUm6cjuxKv09eGybFVJm5reB 0oFn7J50lI3/CMrSuPsNcOKJi96xhrg1nSERVFSLPBRNdZggzdIm3UanPi4G1Yd0cFVY XuLoDweVrFRV87vdR4K0BiFrKX+0JaNnYOXvcVBZJDbEe+9MCqiBnZ91ATULULQc/tYW AinTKSRE8KIFbX+xpzS/SiIk+0SFpIsCKv9DHkDBYyAlzUcv+QssN+yEIWnMR3OvAvhI d5dxnsDzY9znpGDa823IZxlAupDr2xEww1udypVWkKH2DIRh2nowlNgr6DYeXkCiVKEu crfw== X-Gm-Message-State: AOJu0YzUNvbatGcMws41jdNgPlO3UNyVniawmVWFWQcdV0QPlNMhqneR doAu1w1TSdL0S2RLjFg8fDyFBQvkQsY= X-Google-Smtp-Source: AGHT+IH4PJ1KyaxQRHJ8W4jBJfRCnN/YtfwcQAUoVR6a1V8obWQ6lOlBgMWR4l01wI6w4q0bQWgFgA== X-Received: by 2002:a50:cc07:0:b0:54c:6d29:ce8d with SMTP id m7-20020a50cc07000000b0054c6d29ce8dmr1038683edi.2.1702138863509; Sat, 09 Dec 2023 08:21:03 -0800 (PST) Received: from [192.168.0.59] (178-117-137-225.access.telenet.be. [178.117.137.225]) by smtp.gmail.com with ESMTPSA id u28-20020a50a41c000000b0054b286fa48bsm1858381edb.91.2023.12.09.08.21.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Dec 2023 08:21:03 -0800 (PST) Message-ID: <8038a817-c65e-4493-8110-4709943c54a1@gmail.com> Date: Sat, 9 Dec 2023 17:21:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: David CARLIER Cc: PHP internals References: <8f4e3274-6489-4378-82db-fb4829770196@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Filesystem path APIs From: dossche.niels@gmail.com (Niels Dossche) On 12/9/23 10:40, David CARLIER wrote: > On Fri, 8 Dec 2023 at 16:10, Niels Dossche 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.