Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109840 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96119 invoked from network); 25 Apr 2020 09:56:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2020 09:56:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 92E781804B4 for ; Sat, 25 Apr 2020 01:28:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 25 Apr 2020 01:28:46 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id k1so14307126wrx.4 for ; Sat, 25 Apr 2020 01:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=/VuUuQ/GixFLcaC5WB7SHYnrHi5Cm4Usk5zjLucsMyc=; b=jKgtdZ9mqlVcZHaiuNDpK/xT/POmn405e5NnZrXnjsPphpJD09MBYQagpN7xpucEyv 6beWg8cPcB5Xbim1Mfz/xGbh0W9rX/q+ldj+msutlCz0bzvMTubUa16szCzyEDtpqk67 ZPNdOfyLGrgWrI+5iiYF3fwvjWS3ZFn1w17yUzmLLR2R60L0VdEx1PZzwe4kqHCxNFhD E1MQsQLolQDTQXmhtPSBi/VqsfneV/DYUie0ZyXmHEREIYiBWgnNiUYQIf5X57p4s+CZ YrZEoNO1UVYaVtd5/oODmNpoxklVVKtGOagdk7Wnp6TTpaIc+C9LZEH12MP7ZO+yDyTF gsaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=/VuUuQ/GixFLcaC5WB7SHYnrHi5Cm4Usk5zjLucsMyc=; b=Ol/YfHOy03ajVX8EWAMhKrUOZrUc03QWbND7EwbWUAqwTtwPBEQuG4VUU96+dhZfwG ZAAG87GRyVMveKxUw5WD/urGTIBPGXYUfbzVIPKcna115Ultn0b0heVhjGsPeZ5XvblJ bj58JvSobC8yriRAfenBHqgRJUIHNccB8SoSllMQk6C3f1VNKfoUio2bKjSA39PNZeWU 9d5SW29AfycOT5Hp366dvGbJxDE7FMc7Wk7+Y02UR00fkyoSzPqzywGD3mUBfEoUztoJ jvUWcKnysPWZEEualdo/O+1UBTwJy9kV8wVp0t3wXJd/Laq55Bjtp7gAr0Ew4O84isgj FSMA== X-Gm-Message-State: AGi0PuaPpT80Q2Ocm/F8VWQdLCslsuU+XDUQJPLyevs8+S2qyXxj5otd hq4AxzJX7iXmZEoO+u2wz0v3zLHa X-Google-Smtp-Source: APiQypIa+G9fyNfDuUBfdqNYBxGJW13uNuVcBQd8GiYnsTD2+aJUlXuiQKTYDDvjHWjctCDsrbf5OQ== X-Received: by 2002:adf:ee91:: with SMTP id b17mr15966658wro.109.1587803322314; Sat, 25 Apr 2020 01:28:42 -0700 (PDT) Received: from [192.168.0.12] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.gmail.com with ESMTPSA id h17sm6091014wmm.6.2020.04.25.01.28.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Apr 2020 01:28:41 -0700 (PDT) Date: Sat, 25 Apr 2020 09:28:37 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: <5ea1aab8.1c69fb81.72671.791bSMTPIN_ADDED_MISSING@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: PHP internals Message-ID: <434969CF-4FD8-4F57-8999-92FAC43358FA@gmail.com> Subject: Re: [PHP-DEV] Re: [RFC] PHP Namespace Policy From: rowan.collins@gmail.com (Rowan Tommins) Hi Michael, On 25 April 2020 00:00:32 BST, Michael Morris wrote= : >Changing function names and argument orders would lead to BC breaks so >massive people would move away without a transition plan that was >sustainable long term=2E Namespaces give that opportunity, I think=2E You're not the first person to suggest this, indeed I've thought of trying= to write an FAQ for the list, and this would be on it=2E There is some merit to the idea, but there's a snag: just using new names = for new versions of things (which is what a new namespace would be) helps *= machines* know which is which, but it doesn't help *humans* know which is w= hich=2E Instead of "Does strpos take needle or haystack first?" the user wo= uld now have to think "Is this file using the old or new functions? Is one = of them called str_pos and the other strpos, and do they take arguments in = a different order?"=20 The general consensus is that the long-term solution is to add new object-= oriented APIs, including "scalar objects" (syntax to call methods in string= s, integers, etc)=2E That's not necessarily because OO is better, but becau= se it's sufficiently different that it can comfortably sit side by side wit= h the current functions=2E We might have $haystack->positionOf($needle) or = $needle->positionIn($haystack) or both, and strpos would still be available= to all programs with the same arguments it's had for 20 years=2E Similarly, an OO-based file handling API would give us a chance to design = in better error handling so there was no need for the @ operator and lots o= f =3D=3D=3Dfalse checks=2E That new API is the kind of thing that could liv= e under the \PHP namespace, but the old functions wouldn't need to move any= where=2E Regards, --=20 Rowan Tommins [IMSoP]