[PHP-DEV] Re: Literal / Taint checking

2020-02-13 Thread Craig Francis
Hi, While there was a brief discussion about an *is_literal*() method in August, I'm wondering where I can go next? Just as a reminder, the main objection seemed to be that Taint checking is the current solution. For example, those created by Laruence[1], MediaWiki[2], and Matthew[3]. But this

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Ekin B.
Hi all, > On February 13, 2020 1:52 PM Côme Chilliet > wrote: > > > Le mercredi 12 février 2020, 19:20:56 CET Niklas Keller a écrit : > > Naming > > > > I think we shouldn't take over the naming of the super globals, e.g. > > $_GET really contains the query parameters and has nothing to do

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Manuel Canga
On Thu, 13 Feb 2020 at 08:58, Rowan Tommins wrote: > On 12 February 2020 23:12:34 GMT+00:00, Manuel Canga < > manuelca...@gmail.com> wrote: > >El mié., 12 feb. 2020 23:01, Rowan Tommins > >escribió: > >In your example, you has the same options: > > > >> > >1. Change import > >2. Add namespace:

Re: [PHP-DEV] Re: Changing the generated name for anon classes

2020-02-13 Thread Nikita Popov
On Fri, Feb 7, 2020 at 2:35 PM Nikita Popov wrote: > On Thu, Feb 6, 2020 at 9:08 PM Andrea Faulds wrote: > >> Hi, >> >> Nikita Popov wrote: >> > Hi internals, >> > >> > Based on a suggestion by Nicolas Grekas, >> > https://github.com/php/php-src/pull/5153 changes the generated name for >> >

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Côme Chilliet
Le mercredi 12 février 2020, 19:20:56 CET Niklas Keller a écrit : > Naming > > I think we shouldn't take over the naming of the super globals, e.g. > $_GET really contains the query parameters and has nothing to do with > GET or POST, so $request->getQueryParameter(...) would be a better > name.

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Rowan Tommins
On Thu, 13 Feb 2020 at 12:04, Manuel Canga wrote: > > > On Thu, 13 Feb 2020 at 08:58, Rowan Tommins > wrote: > >> On 12 February 2020 23:12:34 GMT+00:00, Manuel Canga < >> manuelca...@gmail.com> wrote: >> >El mié., 12 feb. 2020 23:01, Rowan Tommins >> >escribió: >> >In your example, you has

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Paul M. Jones
Hi Niklas, > On Feb 12, 2020, at 12:20, Niklas Keller wrote: > > I think the request / response API is entirely fine being solved in > userland instead of in php-src. However, since you already made such a > proposal, I want to give some feedback: Re: userland, I gave a counterargument in my

Re: [PHP-DEV] [RFC] token_get_all() TOKEN_AS_OBJECT mode

2020-02-13 Thread Larry Garfield
On Thu, Feb 13, 2020, at 3:47 AM, Nikita Popov wrote: > Hi internals, > > This has been discussed a while ago already, now as a proper proposal: > https://wiki.php.net/rfc/token_as_object > > tl;dr is that it allows you to get token_get_all() output as an array of > PhpToken objects. This

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 2:33 AM, Rowan Tommins wrote: > > On 13 February 2020 03:33:32 GMT+00:00, Mike Schinkel > wrote: >>> On Feb 12, 2020, at 5:47 PM, Rowan Tommins >> wrote: >>> >>> On 12/02/2020 03:58, Mike Schinkel wrote: Returning a_closure_ instead of a string would be providing

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Paul M. Jones
Hi Ruud, > On Feb 13, 2020, at 00:45, Ruud Boon wrote: > > Hi! > > I really like this RFC. Glad to hear it! > In the the RFC I see that $content will return php://input using > file_get_contents on the fly. Can we add the possibility to get a reference > to the stream as well? By "get

Re: [PHP-DEV] Re: [RFC] Adding a "Stringable" interface to PHP 8

2020-02-13 Thread Nicolas Grekas
Hi Patrick, thanks for taking the time to explain your vote. A virtual "stringable" type (that would be similar to "iterable)" would, > IMHO, be of a bigger benefit if it is to denote the fact that "a variable > can be transformed to a string". > By design, when a variable is declared as

[PHP-DEV] Re: [RFC] Adding a "Stringable" interface to PHP 8

2020-02-13 Thread Patrick ALLAERT
Hi, > allow using string|Stringable to express string|object-with-__toString() That goal is expressed in a technical way, rather than a functional one. I have the feeling that addressing the goal: "Can I represent/cast variable $str as a string" would address a broader, yet much more useful,

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Larry Garfield
On Tue, Feb 11, 2020, at 1:08 PM, Dik Takken wrote: > On 11-02-2020 19:46, Larry Garfield wrote: > > > > I would love a nicer way to reference function names; it's really ugly > to do functional code in PHP otherwise, or even just dynamic function > logic within a namespace. If I never have to

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Rowan Tommins
On Thu, 13 Feb 2020 at 17:06, Mike Schinkel wrote: > 1. IF foo::function returns a name string THEN using > Closure::fromCallable( foo::function ) can provide a closure. > > 2. IF foo::function returns a closure THEN how to we get the name string? > Right, I'm with you now. However, I think

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 1:34 PM, Paul M. Jones wrote: > > Hi Mike, > > Thanks for your continued evaluation of the RFC. > >> Take a look at WordPress. It does a lot of "fixup" to $_SERVER` variables — >> to deal with badly implemented web servers — to ensure all known variables >> have a

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 12:26 PM, Rowan Tommins wrote: > Right, I'm with you now. However, I think the answer people are suggesting > to "how do we get the name string?" is "why do we need to?" 1. Say I want to provide users with the ability to build queries and use functions where I want to

Re: [PHP-DEV] RFC: Server-Side Request and Response Objects (v2)

2020-02-13 Thread Paul M. Jones
Hi Mike, Thanks for your continued evaluation of the RFC. > Take a look at WordPress. It does a lot of "fixup" to $_SERVER` variables — > to deal with badly implemented web servers — to ensure all known variables > have a value and that the format of the value is consistent. > > ... > >

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Larry Garfield
On Thu, Feb 13, 2020, at 12:19 PM, Mike Schinkel wrote: > > On Feb 13, 2020, at 12:26 PM, Rowan Tommins wrote: > > Right, I'm with you now. However, I think the answer people are suggesting > > to "how do we get the name string?" is "why do we need to?" > > 1. Say I want to provide users with

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 1:48 PM, Larry Garfield wrote: >> But since I seem to be in the minority of caring about the name, let me >> propose the following which was influenced by Larry Garfield's most >> recent post. Since it seems that people want the convenience of a >> short notation to get

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Larry Garfield
On Thu, Feb 13, 2020, at 2:12 PM, Mike Schinkel wrote: > > On Feb 13, 2020, at 1:48 PM, Larry Garfield wrote: > >> But since I seem to be in the minority of caring about the name, let me > >> propose the following which was influenced by Larry Garfield's most > >> recent post. Since it seems

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Dik Takken
On 13-02-2020 19:19, Mike Schinkel wrote: > But since I seem to be in the minority of caring about the name, let me > propose the following which was influenced by Larry Garfield's most recent > post. Since it seems that people want the convenience of a short notation to > get a closure, how

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Dik Takken
On 13-02-2020 17:55, Larry Garfield wrote: > I walked right into that one, didn't I... You did. :) > Well, Dik asked me to post a "fabulous functional programming example". I > dont' have one, so I'll go with one from the book I'm working on instead. :-) Thanks, much appreciated. > $() or

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Rowan Tommins
On 13 February 2020 18:19:08 GMT+00:00, Mike Schinkel wrote: >Eloquently maybe, but of limited vision. I think that's a rather negative way of putting it; there was a request for use cases, and you have supplied some, so thank you. :) An idea I had earlier which might solve some of them is

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 7:24 PM, Rowan Tommins wrote: > > An idea I had earlier which might solve some of them is if what was returned > was not a normal Closure instance, but a new class like FunctionReference. It > could then "remember" the name of the function wrapped, and implement >

Re: [PHP-DEV] [RFC] token_get_all() TOKEN_AS_OBJECT mode

2020-02-13 Thread Levi Morrison via internals
On Thu, Feb 13, 2020 at 2:48 AM Nikita Popov wrote: > > Hi internals, > > This has been discussed a while ago already, now as a proper proposal: > https://wiki.php.net/rfc/token_as_object > > tl;dr is that it allows you to get token_get_all() output as an array of > PhpToken objects. This reduces

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Mike Schinkel
> On Feb 13, 2020, at 5:26 PM, Dik Takken wrote: > > On 13-02-2020 19:19, Mike Schinkel wrote: >> function foo{} >> >> foo::function — Returns name of function >> foo::fn — Returns closure for function >> >> Since using `fn` creates anonymous function closures it kinda makes sense >> that

Re: [PHP-DEV] [RFC]

2020-02-13 Thread Manuel Canga
On Fri, 14 Feb 2020 at 01:39, Mike Schinkel wrote: > > On Feb 13, 2020, at 7:24 PM, Rowan Tommins > wrote: > > > > An idea I had earlier which might solve some of them is if what was > returned was not a normal Closure instance, but a new class like > FunctionReference. It could then "remember"

[PHP-DEV] [RFC] token_get_all() TOKEN_AS_OBJECT mode

2020-02-13 Thread Nikita Popov
Hi internals, This has been discussed a while ago already, now as a proper proposal: https://wiki.php.net/rfc/token_as_object tl;dr is that it allows you to get token_get_all() output as an array of PhpToken objects. This reduces memory usage, improves performance, makes code more uniform and