Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-03-04 Thread Alexandru Pătrănescu
On Tue, Mar 4, 2025, 23:22 Tim Düsterhus wrote: > > > Or identify that the function has the NoDiscard attribute and based on > that > > do not optimize away the variable? > > First things first: It's not a super important optimization to have, the > assignment to a variable is one of the cheaper

Re: [PHP-DEV] PHP True Async RFC

2025-03-04 Thread Larry Garfield
On Sat, Mar 1, 2025, at 3:11 AM, Edmond Dantes wrote: > Good day, everyone. I hope you're doing well. > > I’d like to introduce a draft version of the RFC for the True Async component. > > https://wiki.php.net/rfc/true_async > > I believe this version is not perfect and requires analysis. And I >

Re: [PHP-DEV] PHP True Async RFC

2025-03-04 Thread Rob Landers
On Tue, Mar 4, 2025, at 23:54, Eugene Sidelnyk wrote: > Hi there, > > I would also like to highlight some interesting ideas that I find being > useful to consider. > > Recently Bend programming language has been released, and it incorporates a > completely different view on the conception of

Re: [PHP-DEV] PHP True Async RFC

2025-03-04 Thread Eugene Sidelnyk
Hi there, I would also like to highlight some interesting ideas that I find being useful to consider. Recently Bend programming language has been released, and it incorporates a completely different view on the conception of "code", in the definition of "what it is" and "how it should be interpre

Re: [PHP-DEV] PHP socket ethernet support - step 2

2025-03-04 Thread Tim Düsterhus
Hi On 3/4/25 23:18, Gina P. Banyard wrote: Those two classes predate the Namespaces in bundled PHP extensions [1] RFC, I do think adding a namespace is better. And we could also move the two classes into the new namespace and add class aliases for the global ones, considering they are quite re

Re: [PHP-DEV] PHP socket ethernet support - step 2

2025-03-04 Thread Gina P. Banyard
On Monday, 3 March 2025 at 21:20, Jakub Zelenka wrote: > Hi, > >> I am working on the second pass of this feature and write here because of >> the legitimate concern regarding new classes to add. >> >> [PR here](https://github.com/php/php-src/pull/17926) > > For those that want to quickly see th

Re: [PHP-DEV] ReflectionClass output for enums

2025-03-04 Thread Gina P. Banyard
On Tuesday, 25 February 2025 at 17:27, Daniel Scherzer wrote: > Hi internals, > > A few months back I sent for > improving the output of `ReflectionClass::__toString()` when used for enums > (and `ReflectionEnum::__toString()`, which just inherits th

Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-03-04 Thread Tim Düsterhus
Hi On 3/4/25 23:08, Alexandru Pătrănescu wrote: Just asking, as my engine knowledge is a bit limited, Wouldn't it be possible that when OPcache would optimize away the unused variable assigned to a function, it could detect that that function have the NoDiscard attribute and also remove the attr

Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-03-04 Thread Alexandru Pătrănescu
Hi Tim, On Tue, Mar 4, 2025, 22:16 Tim Düsterhus wrote: > Hi Marc > > Should the `(void)` cast not be accepted, we will only special case the > assignment to `$_` to not be elided, even if OPcache knows that the > function will never return an object. The behavior for other variables > will rema

Re: [PHP-DEV] Re: RFC: Marking return values as important (#[\NoDiscard])

2025-03-04 Thread Tim Düsterhus
Hi Marc On 3/3/25 17:14, Marc B. wrote: In this thread, I only found the information that currently OPcache does not discard such unused assignments. It would be good to know if such optimization could be considered to not end up in a situation that such optimization would be useful but can't be

RE: [PHP-DEV] [RFC] [Discussion] Optional interfaces

2025-03-04 Thread Juris Evertovskis
Hi all, It's almost awkward to bother the list with this humble RFC amidst so many exciting proposals :) With help from Ilija and Niels the implementation is now working and tested, so the RFC seems getting closer to the voting phase. Ilija raised a point about optional interfaces not b

Re: [PHP-DEV] PHP socket ethernet support - step 2

2025-03-04 Thread David CARLIER
On Mon, 3 Mar 2025 at 21:21, Jakub Zelenka wrote: > Hi, > > >> I am working on the second pass of this feature and write here because of >> the legitimate concern regarding new classes to add. >> >> PR here >> > > For those that want to quickly see the