Re: [PHP-DEV] Putting the match expression in constant expressions in PHP 8.0 or 8.1

2020-08-08 Thread tyson andre
Hi internals, For unrelated reasons detailed in https://github.com/php/php-src/pull/5951#issuecomment-670969676 , I'm not planning on continuing work on this due to issues I found thinking about the proposal. I initially started work on this because the intended behavior seemed underspecified.

Re: [PHP-DEV] Putting the match expression in constant expressions in PHP 8.0 or 8.1

2020-08-08 Thread Guilliam Xavier
On Sat, Aug 8, 2020 at 2:22 AM tyson andre wrote: > Hi internals, > > The match expression can be thought of as a much more concise/readable > equivalent to chained ternary operators. > I'm proposing allowing matches in constant expressions when all parts of > the match are constant expressions.

Re: [PHP-DEV] Putting the match expression in constant expressions in PHP 8.0 or 8.1

2020-08-08 Thread Sara Golemon
On Fri, Aug 7, 2020 at 7:22 PM tyson andre wrote: > The match expression can be thought of as a much more concise/readable > equivalent to chained ternary operators. > I'm proposing allowing matches in constant expressions when all parts of > the match are constant expressions. > > That seems

Re: [PHP-DEV] Putting the match expression in constant expressions in PHP 8.0 or 8.1

2020-08-07 Thread Gabriel Caruso
On Sat, 8 Aug 2020 at 02:22, tyson andre wrote: > Hi internals, > > The match expression can be thought of as a much more concise/readable > equivalent to chained ternary operators. > I'm proposing allowing matches in constant expressions when all parts of > the match are constant expressions. >

[PHP-DEV] Putting the match expression in constant expressions in PHP 8.0 or 8.1

2020-08-07 Thread tyson andre
Hi internals, The match expression can be thought of as a much more concise/readable equivalent to chained ternary operators. I'm proposing allowing matches in constant expressions when all parts of the match are constant expressions. For example, these two class constants would have