Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On 27 August 2024 05:20:32 BST, John Coggeshall wrote: >> I DO think there are likely whole categories of expressions we can likely >> say "no" to - anything where the default represents a union type (and >> _mixed_ is a union type) should likely only allow default by itself or as a >> bare

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Andreas Heigl
Hey all Am 26.08.24 um 20:06 schrieb Bob Weinand: Hey Jim, On 26.8.2024 19:44:18, Jim Winstead wrote: Hi, Another RFC around process: https://wiki.php.net/rfc/web-and-doc-use-not-endorsement Feedback would be appreciated. My intention is to start voting on September 9th unless there is st

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread John Coggeshall
On Aug 26 2024, at 5:27 pm, Matthew Weier O'Phinney wrote: > You'll likely identify the increased delay in such cases. Generally speaking > these sorts of default values don't change a ton, but it's not unlikely that > you may say "I'd like half that delay" or "twice that delay". But a better

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread John Coggeshall
On Aug 26 2024, at 5:57 pm, Bilge wrote: > In case it matters, my initial inclination was also to do what some others > have suggested, and modify the SEND opcodes so that the default is not > actually looked up using reflection at all, but rather we just send nothing > to the function and it

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Derick Rethans
On Mon, 26 Aug 2024, Bob Weinand wrote: > On 26.8.2024 19:44:18, Jim Winstead wrote: > > > > Another RFC around process: > > https://wiki.php.net/rfc/web-and-doc-use-not-endorsement > > > > Feedback would be appreciated. My intention is to start voting on > > September 9th unless there is stil

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-08-26 Thread Dennis Snell
> Hi Everyone, > > I've been working on a new RFC for a while now, and time has come to > present it to a wider audience. > > Last year, I learnt that PHP doesn't have built-in support for parsing URLs > according to any well established standards (RFC 1738 or the WHATWG URL > living standard)

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Bilge
On 26/08/2024 18:44, Jim Winstead wrote: Hi, Another RFC around process: https://wiki.php.net/rfc/web-and-doc-use-not-endorsement Feedback would be appreciated. My intention is to start voting on September 9th unless there is still ongoing discussion. Thanks. Jim It seems improbable to

Re: [PHP-DEV] State of Generics and Collections

2024-08-26 Thread Rob Landers
On Sun, Aug 25, 2024, at 22:28, Gina P. Banyard wrote: > On Friday, 23 August 2024 at 23:55, Rob Landers wrote: >> On Fri, Aug 23, 2024, at 23:06, Larry Garfield wrote: >>> >>> With generics, the syntax isn't the hard part. The hard part is type >>> inference, or accepting that generic-using co

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 11:32, Andreas Heigl wrote: Hey folks. Am 26.08.24 um 11:26 schrieb Bilge: On 26/08/2024 10:03, Andreas Leathley wrote: On 24.08.24 18:49, Bilge wrote: For me there is another question. When using interfaces and classes, default values can be introduced, like this: interface Co

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On 26 August 2024 22:27:55 BST, Matthew Weier O'Phinney wrote: >How exactly is this worrisome? Consider this: > >class A { >public function __construct(private LogInterface $logger = new >DefaultLogger()) { } >} > >class ProxiedLogger implements LogInterface { ... } > >

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 22:27, Matthew Weier O'Phinney wrote: Again, there are a few lists going around on this thread, and I hope that Bilge is taking notes to add to the RFC, and working with the folks who helped him with implementation to determine what is and is not possible in terms of the grammar s

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Matthew Weier O'Phinney
On Mon, Aug 26, 2024 at 3:45 PM John Coggeshall wrote: > > > On Aug 26 2024, at 2:11 pm, Matthew Weier O'Phinney < > mweierophin...@gmail.com> wrote: > > > I can see a few others: > > - string concatenation. I might want to prepend or append a string to a > default. > > - fractional or multiplica

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread John Coggeshall
On Aug 26 2024, at 2:11 pm, Matthew Weier O'Phinney wrote: > > I can see a few others: > > - string concatenation. I might want to prepend or append a string to a > default. > > - fractional or multiplicative application, e.g. for durations/timeouts. > These might require testing for non-zero

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On 26 August 2024 20:27:59 BST, Mike Schinkel wrote: >So, nullable is an equivalent to the union-type concern my discussion with >John Coggeshall uncovered, correct? It's not really anything to do with nulls, or unions. It's somewhat related to "contravariance of input": that it should alwa

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Deleu
On Mon, Aug 26, 2024 at 3:12 PM Bob Weinand wrote: > Thanks for bringing this up - I also suggest that we make this a binary > choice - either we adopt the proposed language or its opposite. > > I.e. a rejection of this should codify that statement in the negative. > > I do in particular reject t

Re: [PHP-DEV] Native SSL support in Phar extension

2024-08-26 Thread Peter Kokot
On Mon, 26 Aug 2024 at 20:05, Calvin Buckley wrote: > As such, it might be a bit tricky for people on Windows/AIX; the easiest > solution if PHAR is using the openssl extension's symbols would be to not > build the openssl extension as shared. I've just checked Windows build and the PHP downloade

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Mike Schinkel
> On Aug 26, 2024, at 8:28 AM, Rowan Tommins [IMSoP] > wrote: > > On Mon, 26 Aug 2024, at 11:43, Mike Schinkel wrote: >>> You ask how a library can provide access to that default, and the answer is >>> generally pretty trivial: define a public constant, and refer to it in the >>> parameter def

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 15:20, Stephen Reay wrote: Hi, Hi :) I haven't followed the entire thread in depth so I apologise if this was already answered, but I haven't noticed it being mentioned/clarified yet. Don't worry, you're right, this is an important topic that I was still finalising in the past

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread John Coggeshall
On Aug 26 2024, at 2:39 pm, Bilge wrote: > > I like this approach. I'm still not sure I'd want to pursue adding > exclusions, but if we can identify something that's obviously bad and/or > dangerous then we can consider that short list for exclusion. That is much > more compelling than starti

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 19:11, Matthew Weier O'Phinney wrote: On Mon, Aug 26, 2024, 12:02 PM Larry Garfield wrote: I recognize that "limiting the allowed expression structures arbitrarily is way harder than it sounds" is a valid argument as well.  At the same time, John C has offered some

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Larry Garfield
On Mon, Aug 26, 2024, at 1:06 PM, Bob Weinand wrote: > Hey Jim, > > On 26.8.2024 19:44:18, Jim Winstead wrote: >> Hi, >> >> Another RFC around process: >> https://wiki.php.net/rfc/web-and-doc-use-not-endorsement >> >> Feedback would be appreciated. My intention is to start voting on September >

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Matthew Weier O'Phinney
On Mon, Aug 26, 2024, 12:02 PM Larry Garfield wrote: > On Mon, Aug 26, 2024, at 6:36 AM, Jakob Givoni wrote: > > On Mon, Aug 26, 2024 at 12:49 PM Rowan Tommins [IMSoP] > > wrote: > >> On Mon, 26 Aug 2024, at 10:14, Bilge wrote: > >> > You're absolutely right, I would be interested to see any via

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Bob Weinand
Hey Jim, On 26.8.2024 19:44:18, Jim Winstead wrote: Hi, Another RFC around process: https://wiki.php.net/rfc/web-and-doc-use-not-endorsement Feedback would be appreciated. My intention is to start voting on September 9th unless there is still ongoing discussion. Thanks. Jim Thanks for

Re: [PHP-DEV] Native SSL support in Phar extension

2024-08-26 Thread Calvin Buckley
On Aug 26, 2024, at 1:23 PM, Peter Kokot wrote: > > Hello, > > There came up another idea/issue about the Phar extension and its > native SSL support. > > As you might know or not, when building PHP: > > ./configure --with-openssl --enable-phar > > the Phar extension will get so-called native

Re: [PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Deleu
Hi Jim! On Mon, Aug 26, 2024 at 2:48 PM Jim Winstead wrote: > Hi, > > Another RFC around process: > https://wiki.php.net/rfc/web-and-doc-use-not-endorsement > > Feedback would be appreciated. My intention is to start voting on > September 9th unless there is still ongoing discussion. > > Thanks.

[PHP-DEV] [RFC] [Discussion] Using and Mentioning Third-party Packages in PHP Documentation and Web Projects

2024-08-26 Thread Jim Winstead
Hi, Another RFC around process: https://wiki.php.net/rfc/web-and-doc-use-not-endorsement Feedback would be appreciated. My intention is to start voting on September 9th unless there is still ongoing discussion. Thanks. Jim

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread John Coggeshall
> From the example you gave it appears that we can have a concrete problem when: > 1. There is a parameter with a default value, > 2. That parameter is type-hinted, > 3. The hinted type is declared as a union type, > 4. An earlier version of the library initialized the default with a value > havi

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bob Weinand
Hey Jordi, On 26.8.2024 13:55:52, Jordi Boggiano wrote: One question (sorry if someone already asked, I scanned the thread but it is getting long..): Taking this example from the RFC:     function g($p = null) {         f($p ?? default);     } Could you go one step further and use default by

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Larry Garfield
On Mon, Aug 26, 2024, at 6:36 AM, Jakob Givoni wrote: > On Mon, Aug 26, 2024 at 12:49 PM Rowan Tommins [IMSoP] > wrote: >> On Mon, 26 Aug 2024, at 10:14, Bilge wrote: >> > You're absolutely right, I would be interested to see any viable patch >> > that effectively implements a set of restriction

[PHP-DEV] Native SSL support in Phar extension

2024-08-26 Thread Peter Kokot
Hello, There came up another idea/issue about the Phar extension and its native SSL support. As you might know or not, when building PHP: ./configure --with-openssl --enable-phar the Phar extension will get so-called native SSL enabled through OpenSSL directly. However, when built like this: .

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bruce Weirdan
On Mon, Aug 26, 2024 at 12:47 PM Rowan Tommins [IMSoP] wrote: > Another approach that occurred to me was in the executor: rather than > evaluating to the default value immediately, "default" could resolve to a > special value, essentially wrapping the reflection parameter info. Then > when the fu

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Chuck Adams
On Mon, Aug 26, 2024 at 5:36 AM, Jakob Givoni <[ja...@givoni.dk](mailto:On Mon, Aug 26, 2024 at 5:36 AM, Jakob Givoni < wrote > "default" should not evaluate to a value before sending it as an argument to > the function or method. I have no dog in this fight, but I agree with the above. Plus, h

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Stephen Reay
> On 24 Aug 2024, at 23:49, Bilge wrote: > > Hi gang, > > New RFC just dropped: https://wiki.php.net/rfc/default_expression. I think > some of you might enjoy this one. Hit me with any feedback. > > This one already comes complete with working implementation that I've been > cooking for a l

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 12:55, Jordi Boggiano wrote: Hey Bilge, Hi :) On 24.08.2024 18:49, Bilge wrote: New RFC just dropped: https://wiki.php.net/rfc/default_expression. I think some of you might enjoy this one. Hit me with any feedback. Great work overall, I'm all for it and even though it's not s

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On Mon, 26 Aug 2024, at 11:43, Mike Schinkel wrote: >> On Aug 26, 2024, at 3:28 AM, Rowan Tommins [IMSoP] >> wrote: >> I was responding to someone justifying anything and everything the proposal >> allows, because Reflection already allows it. If the feature was "first >> class syntax to access

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On Mon, 26 Aug 2024, at 11:43, Mike Schinkel wrote: >> You ask how a library can provide access to that default, and the answer is >> generally pretty trivial: define a public constant, and refer to it in the >> parameter definition. > > A global? Really? I didn't say "global", I said "public".

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Jordi Boggiano
Hey Bilge, On 24.08.2024 18:49, Bilge wrote: New RFC just dropped: https://wiki.php.net/rfc/default_expression. I think some of you might enjoy this one. Hit me with any feedback. Great work overall, I'm all for it and even though it's not something I saw myself using a whole lot, the json_e

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Jakob Givoni
On Mon, Aug 26, 2024 at 12:49 PM Rowan Tommins [IMSoP] wrote: > On Mon, 26 Aug 2024, at 10:14, Bilge wrote: > > You're absolutely right, I would be interested to see any viable patch > > that effectively implements a set of restrictions on how `default` may > > be used. Requesting it be done at t

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On Mon, 26 Aug 2024, at 10:03, Andreas Leathley wrote: > interface CompressionInterface > { >     public function compress(string $data, int $level): string; > } > > class GzipCompression implements CompressionInterface > { >     public function compress(string $data, int $level = 4): string >  

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On Mon, 26 Aug 2024, at 10:14, Bilge wrote: > You're absolutely right, I would be interested to see any viable patch > that effectively implements a set of restrictions on how `default` may > be used. Requesting it be done at the parser level was not meant as a > gotcha, that's just how I (with

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Mike Schinkel
> On Aug 26, 2024, at 2:26 AM, John Coggeshall wrote: > The proposal in the RFC creates a new dependency and backward compatibility > issue for API developers that currently does not exist. It is not just > because it allows for non-sensical expressions, but that it allows perfectly > sensical

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 08:28, Rowan Tommins [IMSoP] wrote: As far as I can see, nobody has actually justified reading values out in this way, only said it's a side-effect of the current implementation. It's pretty useful for testing. Aside: one of those examples brings up an interesting question: is th

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Andreas Heigl
Hey folks. Am 26.08.24 um 11:26 schrieb Bilge: On 26/08/2024 10:03, Andreas Leathley wrote: On 24.08.24 18:49, Bilge wrote: For me there is another question. When using interfaces and classes, default values can be introduced, like this: interface CompressionInterface {     public function co

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 11:11, Andreas Leathley wrote: On 26.08.24 11:26, Bilge wrote: I would like to fix this if possible, because I think this should be valid, with emphasis on /if possible/, because it may be prohibitively complex. Will update later. That would be a way to fix it, to basically ma

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Andreas Leathley
On 26.08.24 11:26, Bilge wrote: Thanks for this question; I find this super interesting because it's something we haven't thought about yet. I must admit I completely overlooked that, whilst an interface /can/ require implementers to specify a default, in the case that they do not, it is still v

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 10:03, Andreas Leathley wrote: On 24.08.24 18:49, Bilge wrote: For me there is another question. When using interfaces and classes, default values can be introduced, like this: interface CompressionInterface {     public function compress(string $data, int $level): string; } clas

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Bilge
On 26/08/2024 09:58, Christoph M. Becker wrote: On 25.08.2024 at 23:51, Bilge wrote: If you believe I am incorrect about this, I encourage you to submit a (working) Bison patch to demonstrate how a restricted expression grammar subset can still recurse with the unrestricted superset, then we ca

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Andreas Leathley
On 24.08.24 18:49, Bilge wrote: Hi gang, New RFC just dropped: https://wiki.php.net/rfc/default_expression. I think some of you might enjoy this one. Hit me with any feedback. This one already comes complete with working implementation that I've been cooking for a little while. Considering I do

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Christoph M. Becker
On 25.08.2024 at 23:51, Bilge wrote: > If you believe I am incorrect about this, I encourage you to submit a > (working) Bison patch to demonstrate how a restricted expression grammar > subset can still recurse with the unrestricted superset, then we can > start having this discussion more serious

Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API

2024-08-26 Thread Máté Kocsis
Hi Ignace, Niels, Sorry for being silent for so long, I was working hard on the implementation besides some summer activities :) I can say that I had really good progress in the last month and now I think (hope) that I managed to address most of the concerns/suggestions people mentioned in this th

Re: [PHP-DEV] [RFC] Default expression

2024-08-26 Thread Rowan Tommins [IMSoP]
On 26 August 2024 05:44:44 BST, Mike Schinkel wrote: >> On Aug 25, 2024, at 12:21 PM, Rowan Tommins [IMSoP] >> wrote: >> The Reflection API is a bit like the Advanced Settings panel in a piece of >> software, it comes with a big "Proceed with Caution" warning. You only move >> something fr