Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109667 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58793 invoked from network); 15 Apr 2020 21:23:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Apr 2020 21:23:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 961DA1804D0 for ; Wed, 15 Apr 2020 12:53:56 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.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 ; Wed, 15 Apr 2020 12:53:55 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id m19so3585383lfq.13 for ; Wed, 15 Apr 2020 12:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kGH1R8VJbs5xCsEn1opHOhWF10FvFYiNEHfu2cp6P4o=; b=Md3z7MGWsQusc1afJgrNLVL3DCujGppIdXIHDxnHuW5TOgfkRXCzUShSe5+ZnN8zRx jwYSmRIHcxoPf3udRuKpX29xuWWnrOlb4cGJOE7/IuWnK73yT2xVWiZBcODHngiCBoqD T7gvpMz8aw//zrnv9q3nKCN9ALtZwPov6tX7axlIScOZd6cjhbIX+yhhKxG8hJ8kSUCx LGAffKZ8LJKMHlp9MEnNz/WW7gPo8t2X/EXsXRaIQrTvUfaJj2xHnc/s3459CK4A3tCT PHgaZMQHe8u7oQqH+s3m5L7BuEpWq1svNMyzXwog5FDiG9eqhi40ccLExFHKZd6hE/GH TizQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kGH1R8VJbs5xCsEn1opHOhWF10FvFYiNEHfu2cp6P4o=; b=la5ZSkDIX5nLGRG1T0HVbVICsga0tUtJu99Mxh5XzqZIDatB67NwOnGYvxeDtSXV0k ZloZEI5j08YeyiTZH+9uobqAFHpSk/fEkV6VlAxID1j7immVXv9JahUMRGuZIKXl0xnn J96ODDWFLGPzxrJWbcpPrc2O3pmunogsGgKR0SscKup36eNX1pVhVsijqEekQbmDkaXk OCJgW1Ct9jd3pYVvVEt9n6lJmhMPKOF7u6V4xBg7Sh1pgGxvlOJw5CVAhrxvqYZOFf6C wd5LphpFU1SVA2iiz42lEB/Up0haySCVzsrrn17GzQ2Vlm2Z4v98fw85Y+x/kUCwFOdB Or1A== X-Gm-Message-State: AGi0Puam19jFpWKBo7JALTrchHHOcSLdgsPk+mG5/jcv/JT2udYfMlhP zjh0xOidlPidOctfmbmhoN08aThoStxiuUyrrzE4El1NbJk= X-Google-Smtp-Source: APiQypIetvGqEr4YMYjbM0RJgmB324HIYMkVOUt8KAb8pQwnTQPoF80uSNBKfwrUh6BP/8MW4bl1Ti3Wh1NZUbPE5v8= X-Received: by 2002:a17:906:81d7:: with SMTP id e23mr6047122ejx.309.1586980431082; Wed, 15 Apr 2020 12:53:51 -0700 (PDT) MIME-Version: 1.0 References: <5e974337.1c69fb81.62230.5d05SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <5e974337.1c69fb81.62230.5d05SMTPIN_ADDED_MISSING@mx.google.com> Date: Wed, 15 Apr 2020 21:53:40 +0200 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000dc391605a359acf5" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] PHP Namespace in core From: george.banyard@gmail.com ("G. P. B.") --000000000000dc391605a359acf5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 15 Apr 2020 at 19:24, Andrea Faulds wrote: > Hi, > > Micha=C5=82 Brzuchalski wrote: > > Hi Marcio, > > > > =C5=9Br., 15 kwi 2020 o 18:39 Marcio Almada > napisa=C5=82(a): > > > >> Even though I'm fond to the idea of languages having the official > >> stdlib contained > >> into a single space, there seems to be no practicality on a \PHP > namespace > >> usage > >> at this point IMMO. > >> > >> We would be in a situation where things are either mixed in and out > >> the new namespace > >> - Should I `use function PHP\{json_encode, json_decode}` or was it in > >> the root??? - or > >> everything that already exists must first receive an alias into this > >> new namespace, to allow > >> consistency... but then there would probably be no plans ever to > >> actually move existing stuff > >> into the new prefix in the future. > >> > >> > > You've misunderstood the idea. Standard library functions classes etc. > are > > not language features. > > It's not a purpose of this RFC to move existing functions from the > standard > > library but to allow core language features > > to use it. Described examples show benefit in use for symbols tightly > > coupled to features PHP as a language delivers. > > > > Most of the standard library function can be replaced by implementation= s > in > > PHP or by wrapping around a C library. > > The features tightly coupled with the language is for eg. the Reflectio= n > > mechanism, PhpToken class as described. > > Upcoming PhpAttributes for which proposal is a work in progress. > > > > Those all features will not likely be moved to PECL and this RFC propos= al > > is to allow features like that to use PHP namespace. > > We already have PHP language features relying on classes in the root > namespace (Closure, Throwable, ArrayAccess, etc) so the point Marcio > makes about inconsistency is nonetheless valid I think. > > Thanks, > Andrea > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > The proposal is not to move everything into the PHP namespace. I would even argue that these interface make more sense in the global namespace as they are meant to be available to all users to implement and extend. This is in strong contract to the Reflection API which, at least, should no= t be extended by end users IMHO as it provided features which are heavily tied to the engine and how it is implemented. Now as Reflection is already an existing feature the objective here is not to move the current one into the PHP namespace and alias it but possibly provide a Reflection 2.0 API which is design with the benefit of hindsight. A more relevant example, in my eyes, is the current proposal of attributes. Engine attributes like JIT, NoJIT, and possibly in the future Deprecated and/ or Final are features provided by the engine which should not have the possibility to be extended by end users, only consumed. Another example I can come up are scalar objects. If PHP starts to provided scalar objects, I would imagine that they it won'= t be possible to extend them and only consume them, in the same way as the current functions provided by ext/standard. Or maybe a new API to interact with stream and/or the file system. I hope this clarifies the intent behind the RFC. Best regards George P. Banyard --000000000000dc391605a359acf5--