Re: [PHP-DEV] Default value for readonly properties

2024-06-07 Thread Valentin Udaltsov
ing example (https://3v4l.org/dSpQO) where `$storage` can not be replaced with a constant. And it would be nice if `$storage` could be initialized without a constructor. I just looked at some of my PHP >=8.1 projects and noticed that I have a few places where the constructor has no parameters and only exists to initialize readonly properties with smth like `SplQueue`. -- Valentin Udaltsov

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-04 Thread Valentin Udaltsov
On June, 4 at 15:32, Nicolas Grekas wrote: > Dear all, > > Arnaud and I are pleased to share with you the RFC we've been shaping for > over a year to add native support for lazy objects to PHP. > > Please find all the details here: > https://wiki.php.net/rfc/lazy-objects > > We look forward to

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-29 Thread Valentin Udaltsov
string.php#91628 > Hi, Peter! > Also, as a side note, why does this hack below work? It's not a hack. Variables, including callable ones with any arguments are allowed to be interpolated. See another example: https://3v4l.org/BJUvL -- Regards, Valentin Udaltsov

[PHP-DEV] Re: [RFC][Vote] new MyClass()->method() without parentheses

2024-05-28 Thread Valentin Udaltsov
On Thursday, 9 May 2024 at 18:26, Valentin Udaltsov < udaltsov.valen...@gmail.com> wrote: > The vote for the RFC that allows to omit parentheses around the `new` > expression is now open: > > https://wiki.php.net/rfc/new_without_parentheses > > Voting will close on

Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-27 Thread Valentin Udaltsov
On Mon, May 27, 2024 at 14:21 Alexandru Pătrănescu wrote: > > On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov < > udaltsov.valen...@gmail.com> wrote: > >> Hello, internals! >> >> Here's the idea: let's extract `ArrayAccess::offsetExists` and >> `Array

[PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-26 Thread Valentin Udaltsov
/collections package might look like this: namespace Doctrine\Common\Collections; interface ReadableCollection extends Countable, IteratorAggregate, ArrayAccessRead {} interface Collection extends ReadableCollection, ArrayAccess {} ``` -- Regards, Valentin Udaltsov

Re: [PHP-DEV] RFC [Discussion]: array_find

2024-05-24 Thread Valentin Udaltsov
I'm looking forward to your feedback. > Cheers > Joshua Rüsweg > > Hi, Joshua! Have you considered renaming `$callback` parameter to `$predicate`? I always considered "callback" to be a very generic word. Predicate, on the contrary, implies accepting a value and returning a bool. -- Valentin Udaltsov

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
Yes, I've done that, see https://externals.io/message/123293. чт, 9 мая 2024 г. в 20:11, Larry Garfield : > On Thu, May 9, 2024, at 3:26 PM, Valentin Udaltsov wrote: > > @Lynn, @Alex, thank you for your comments. I have improved the "without > > constructor argument

[PHP-DEV] [RFC][Vote] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
The vote for the RFC that allows to omit parentheses around the `new` expression is now open: https://wiki.php.net/rfc/new_without_parentheses Voting will close on Friday 24 May, 00:00 GMT. -- Best regards, Valentin

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
e: > >> On Tue, Apr 23, 2024 at 11:10 AM Valentin Udaltsov >> wrote: >> > >> > >> > Does anyone have additional feedback? I'd like to start voting on >> Thursday, April 25th. >> > I've also added a section on other syntax ideas that

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-23 Thread Valentin Udaltsov
вт, 9 апр. 2024 г. в 19:41, Larry Garfield : > On Mon, Apr 8, 2024, at 6:08 AM, Valentin Udaltsov wrote: > > Hello internals, > > > > > > > > I would like to propose a syntax change for PHP 8.4 that allows to > > immediately access instantiated

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-09 Thread Valentin Udaltsov
> > On Mon, Apr 8, 2024, at 6:08 AM, Valentin Udaltsov wrote: > > Hello internals, > > > > > > > > I would like to propose a syntax change for PHP 8.4 that allows to > > immediately access instantiated objects without wrapping the expression > > into

[PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-08 Thread Valentin Udaltsov
Hello internals, I would like to propose a syntax change for PHP 8.4 that allows to immediately access instantiated objects without wrapping the expression into parentheses. This was requested and discussed several times, see: - https://externals.io/message/66197 -

[PHP-DEV] RFC karma request

2023-12-28 Thread Valentin Udaltsov
Hi internals, I kindly request RFC Karma for my wiki account vudaltsov. I am planning to publish RFC "new MyClass()->method() without parentheses". I already created a PR, where I got generally positive feedback on this feature: https://github.com/php/php-src/pull/13029 Regards, Valentin