Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108510 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56733 invoked from network); 12 Feb 2020 18:40:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Feb 2020 18:40:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 11F441804F8 for ; Wed, 12 Feb 2020 08:54:16 -0800 (PST) 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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29169 217.70.176.0/20 X-Spam-Virus: No X-Envelope-From: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 12 Feb 2020 08:54:14 -0800 (PST) Received: from samurai.attlocal.net (107-223-28-39.lightspeed.nsvltn.sbcglobal.net [107.223.28.39]) (Authenticated sender: pmjones@pmjones.io) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 13FF0240008; Wed, 12 Feb 2020 16:54:12 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: <5500e8e70ed1cdc162e5848b8959c63d8adc4853.camel@schlueters.de> Date: Wed, 12 Feb 2020 10:54:11 -0600 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <6EE2BBA9-882A-4879-A6E7-E3262DD88B75@pmjones.io> References: <50BD013E-CF72-414C-BBC0-A7A2E45CBDDB@pmjones.io> <5500e8e70ed1cdc162e5848b8959c63d8adc4853.camel@schlueters.de> To: =?utf-8?Q?Johannes_Schl=C3=BCter?= X-Mailer: Apple Mail (2.3608.60.0.2.5) Subject: Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2) From: pmjones@pmjones.io ("Paul M. Jones") Hi Johannes, > What indication is there that this will be more successfull than the > filter API? Fair question. While I can't say how successful (or not) ext/filter has = been, I *can* say that the proposal does not present extraordinary or = dramatically different ways of working than PHP does currently. The extent of the RFC is only to provide behaviors similar to what PHP = already does, in object-oriented dress. That is, whereas ext/filter = might have been been described as "a new and different way of working", = the concepts and functions in this RFC (even down to the method and = property names!) should be immediately familiar even to junior PHP = developers. > Historically PHP isn't really successful in providing higher level = APIs > to things and I think leaving this to userland is very viable, since > composer and performance improvements in later PHP 5 and PHP 7. I addressed the "userland" argument in my response to Mark Randall; = please forgive me for not repeating it here. > Also use of $_* is fast to grep for and gives me directly in the grep > an idea about the mess-factor of a code base, tracing all calls to a > member of an instance of a class is harder. (and yes, references etc. > to super globals aren't trivial to trace, but also rare) I feel your pain! I do a lot of legacy work too. The `$_` signature = makes grepping easy, so that I can find places where there is = spooky-action-at-a-distace from globally mutable state. However, ServerRequest is intended to reduce or remove that globally = mutable state. The $request->get property is readonly, and neither = global nor superglobal. So, while it is tougher to grep for `->get` and = know that you have found a ServerRequest property, the *need* to do so = should be much less even in legacy codebases. > Let PHP provide the access to the data and promote the API library of = the year. "API library of the year" -- heh. To be fair, though, the API presented by ServerRequest and = ServerResponse is highly similar to that presented by PHP itself; far = from being "API of the year" it honors existing PHP functionality quite = closely. --=20 Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php