Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Valentin Udaltsov
On Tue, 4 Feb 2025 at 07:35, Larry Garfield wrote: > Hi folks. Ilija is still working on the implementation for the pattern > matching RFC, which we want to complete before proposing it officially in > case we run into implementation challenges. > > Such as these, on which we'd like feedback on

[PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Mihail Liahimov
Thank you for your answer. Now I will give examples for better understanding. Simple examples from Typescript: let foo = ... foo!.bar() foo!.someProperty.baz() Examples of potentially using in PHP: Without this operator we writing this code: $foo = ... if ($foo === null) { throw new FooIsN

Re: [PHP-DEV] Allow to easily retrieve non-default INI settings / GH PR 17459

2025-02-06 Thread Jakub Zelenka
Hi, On Thu, Feb 6, 2025 at 9:57 AM Tim Düsterhus wrote: > Hi > > this email concerns my PR https://github.com/php/php-src/pull/17459, > which extended the cli-SAPI’s `--ini` flag to print any INI settings > that differ from the built-in default. There was some discussion around > which flag to u

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Morgan
On 2025-02-04 17:31, Larry Garfield wrote: However, there is a concern that it wouldn't be self-evident to PHP devs, and the variable binding side should have the extra marker. Ilija has suggested &, as that's what's used for references, which would result in: $b = '12'; if ($arr is ['a' =

[PHP-DEV] Allow to easily retrieve non-default INI settings / GH PR 17459

2025-02-06 Thread Tim Düsterhus
Hi this email concerns my PR https://github.com/php/php-src/pull/17459, which extended the cli-SAPI’s `--ini` flag to print any INI settings that differ from the built-in default. There was some discussion around which flag to use, which didn't result in particularly strong opinions, with the

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Larry Garfield
On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > Hi, Larry! > > First of all, I'm very excited about your Pattern Matching RFC and > looking forward to it. > >> Because PHP uses only an LL(1) parser > > Are there any plans to upgrade the parser to bypass these limitations? > I remembe

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Larry Garfield
On Thu, Feb 6, 2025, at 6:50 AM, Mihail Liahimov wrote: > Thank you for your answer. Now I will give examples for better > understanding. > > Simple examples from Typescript: > > let foo = ... > foo!.bar() > foo!.someProperty.baz() > > Examples of potentially using in PHP: > Without this operator w

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Mihail Liahimov
Thank you for your answer. Now I will give examples for better understanding. Simple examples from Typescript: let foo = ... foo!.bar() foo!.someProperty.baz() Examples of potentially using in PHP: Without this operator we writing this code: $foo = ... if ($foo === null) { throw new FooIsNullE

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Ilija Tovilo
Hi Mihail On Thu, Feb 6, 2025 at 1:51 PM Mihail Liahimov <91lia...@gmail.com> wrote: > > Examples of potentially using in PHP: > Without this operator we writing this code: > > $foo!->bar > $foo!->someProperty->method(); > $foo!->someProperty->anotherProperty!->method(); > > I think the postfix op

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Christoph M. Becker
On 06.02.2025 at 15:48, Ilija Tovilo wrote: > * Is assert($foo !== null); $foo->bar; really much worse? I understand > it requires two statements, so it cannot be used in all contexts. In my opinion, it is better, because you can completely disable the assertion checking in production. > * Are w

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Christoph M. Becker
On 06.02.2025 at 20:24, Larry Garfield wrote: > On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > >>> Because PHP uses only an LL(1) parser Actually, we're using an LALR(1) parser; LL(1) is more constrained (although, personally, I like those for their simplicity). >> Are there any pla

[PHP-DEV] [RFC] Pipe Operator (again)

2025-02-06 Thread Larry Garfield
Hi folks. A few years ago I posted an RFC for a pipe operator, as seen in many other languages. At the time it didn't pass, in no small part because the implementation was a bit shaky and it was right before freeze. Nonetheless, there are now even more (bad) user-space implementations in the

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-06 Thread Faizan Akram Dar
On Fri, 7 Feb 2025, 08:30 Mihail Liahimov, <91lia...@gmail.com> wrote: > Thank you for your answer. Now I will give examples for better > understanding. > > Simple examples from Typescript: > > let foo = ... > foo!.bar() > foo!.someProperty.baz() > > Examples of potentially using in PHP: > Without

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-02-06 Thread Eugene Sidelnyk
Hi, Larry, That's super! I hope it will pass! Oladoyinbo, IMO the way it is described right now (e.g. explicit closures) is much more elegant than a new way of doing things that's not so obvious and will be necessary to keep in mind and support anyway. If it'd be necessary to simplify the stuff,

Re: [PHP-DEV] [RFC] Pipe Operator (again)

2025-02-06 Thread Oladoyinbo Vincent
PHP codebase in general is quite unreadable due to robust way of doing things. Pipe operator might make things more complicated even more... But after reading the RFC, something came to my mind, a way to simplify this stuff What if we implement it this way: ```php $pipe = " hello world "

Re: [PHP-DEV] Deprecate building ext/ldap against Oracle LDAP

2025-02-06 Thread Christoph M. Becker
On 09.11.2024 at 17:18, Christoph M. Becker wrote: > there has been some discussion about this in a GH issue[1]. > > TL;DR: building ext/ldap against Oracle LDAP had been supported, and is > theoretically still supported, but is apparently broken for a while. > The Oracle LDAP implementation is pa

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Ilija Tovilo
On Thu, Feb 6, 2025 at 10:43 PM Christoph M. Becker wrote: > > On 06.02.2025 at 20:24, Larry Garfield wrote: > > > On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > > > >> Are there any plans to upgrade the parser to bypass these limitations? > >> I remember Nikita shared some thoughts o

[PHP-DEV] Update DOM extension version?

2025-02-06 Thread Christoph M. Becker
Hi all, recently, I've stumbled upon an older bug report which claimed that the version of ext/dom would be incorrect[1]. Since this still is reported as "20031129" (!), I submitted a PR[2] to update that according to the usual convention that bundled extensions report the same version as PHP (e.

[PHP-DEV] [VOTE] First Class Callables in constant expressions

2025-02-06 Thread Volker Dusch
Hey everyone, We just started the vote on the "First Class Callables in constant expressions" RFC. References: RFC: https://wiki.php.net/rfc/fcc_in_const_expr Implementation: https://github.com/php/php-src/pull/17213 Discussion: https://externals.io/message/126217#126217 The vote will end in tw

[PHP-DEV][RFC] Add mb_levenshtein function

2025-02-06 Thread youkidearitai
Hello, internals. I did send about mb_levenshtein function at last year. https://externals.io/message/125674 And, I updated an RFC. Please check below: https://wiki.php.net/rfc/mb_levenshtein I would like moving forward to vote phase an RFC. Feel free to comment, If nothing anymore, I will start