On 15 February 2020 20:10:30 GMT+00:00, "Paul M. Jones" <pmjo...@pmjones.io> 
wrote:
>Hi all,
>
>> On Feb 15, 2020, at 02:01, Larry Garfield <la...@garfieldtech.com>
>wrote:
>> 
>> ... is this proposal intended to supplant HttpFoundation and PSR-7
>... ?
>
>This is question is answered in the RFC introduction


You've cut Larry's question in half there, and in doing so made it seem like a 
repeat, when it is not. The second half of the sentence is this:


> ...or to become a common underpinning that both of them wrap, or to be a 
> third cohabitating implementation in the ecosystem?


I haven't seen you answer that part yet: do you expect existing userland 
libraries to migrate from wrapping $_GET etc to using these built-in wrappers. 
If so, what benefit does it bring those libraries? If not, who is its intended 
audience?


You said previously:

> PDO did not (to my knowledge) "add capabilities which cannot exist in 
> userland or cannot exist in a reasonably performant way".

I think this is a misjudgement, and a relevant one. PDO didn't take 
functionality that existed purely in userland and migrate it to an extension; 
it took functionality that was scattered across a dozen different 
vendor-specific extensions with different naming and calling conventions, and 
centralised it into one more-or-less consistent interface. In doing so, it made 
(or at least tried to make) life easier both for database vendors, who can 
provide a PDO driver and fit into the ecosystem, and library developers, who 
can use PDO as a base and have less vendor-specific code.

Your other examples - date, phar, and session - took common problems that were 
possible to solve in userland but tricky to solve well, and provided a standard 
out-of-the-box implementation.

We already have a unified out-of-the-box implementation for the problem "get 
data out of HTTP request", in the form of superglobals, so neither comparison 
seems apt.

A better comparison might be to features which have been reimplemented multiple 
times, to fix fundamental problems. A recent example is __serialize, but 
interestingly $_GET et al are themselves the third implementation of the 
feature, after "register globals" and the $HTTP_* arrays.

As far as I can see, the RFC mentions two things it fixes about the current 
implementation:

- The current implementation is not OO. That's not really surprising, since PHP 
is not a purely OO language, and treats OO as a matter of style - to the extent 
of providing hybrid object-procedural APIs like date and mysqli.

- The current implementation is based on global state. This is definitely 
something that would be good to fix, but you can do almost as much in that 
direction as the RFC by writing "$get=$_GET; unset($_GET);" The hard problem is 
that the entry point for a request is in global scope, not a main() or 
handleRequest() function. Introducing these objects as part of a new calling 
convention for PHP scripts would definitely add value, and make them a true 
replacement for the superglobals, but that would be a very different RFC.


However well designed this extension is within itself, I think it needs a 
stronger description of who should use it and why.


Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to