Re: [PHP-DEV] Re: Basic Type Alias

2024-01-25 Thread Mönôme Epson
Hello, I took the time to read you. Very interesting discussion. I'm also interested in the type definition. Because these two functions are equivalent: > function foo(?int $baz) {} > function foo(null|int $baz) {} We could imagine a personalized null-safety type. > typedef Refutable as null|fa

Re: [PHP-DEV] Discussion: making continue and break into an expression

2024-01-25 Thread Ilija Tovilo
Hi Larry On Thu, Jan 25, 2024 at 6:38 PM Larry Garfield wrote: > > On Thu, Jan 25, 2024, at 11:28 AM, Ilija Tovilo wrote: > > > > This leads to very similar issues as break/continue inside blocks. See: > > https://wiki.php.net/rfc/match_blocks#technical_implications_of_control_statements > > > I'

Re: [PHP-DEV] Discussion: making continue and break into an expression

2024-01-25 Thread Larry Garfield
On Thu, Jan 25, 2024, at 11:28 AM, Ilija Tovilo wrote: > This leads to very similar issues as break/continue inside blocks. See: > https://wiki.php.net/rfc/match_blocks#technical_implications_of_control_statements > > I'll try to explain. > > The VM works with temporary variables. For the express

Re: [PHP-DEV] Re: [RFC] [Vote] Resource to object conversion

2024-01-25 Thread Nicolas Grekas
Hello Mate, I've just closed the votes with the following outcomes: > - The primary vote for the described approach for converting resources to > objects was accepted unanimously (30 yes, 0 no) > - Primary stream resources are going to be migrated in a major version, > rather in any minor or major

Re: [PHP-DEV] Discussion: making continue and break into an expression

2024-01-25 Thread Ilija Tovilo
Hi Robert On Thu, Jan 25, 2024 at 10:16 AM Robert Landers wrote: > > Now that throwing is an expression, it allows for some very concise > programming. What are your thoughts on making a break/continue into an > expression as well? > > Instead of: > > while(true) { > ... > if(is_null($arr['var'])

Re: [PHP-DEV] Discussion: making continue and break into an expression

2024-01-25 Thread Rokas Šleinius
On Thu, Jan 25, 2024, 11:16 Robert Landers wrote: > Hello internals, > > Now that throwing is an expression, it allows for some very concise > programming. What are your thoughts on making a break/continue into an > expression as well? > > Instead of: > > while(true) { > ... > if(is_null($arr['va

[PHP-DEV] Discussion: making continue and break into an expression

2024-01-25 Thread Robert Landers
Hello internals, Now that throwing is an expression, it allows for some very concise programming. What are your thoughts on making a break/continue into an expression as well? Instead of: while(true) { ... if(is_null($arr['var'])) continue; if($something) continue; else break; ... } You could w