Re: [PHP-DEV] [RFC] Shorter Attribute Syntax Change RFC 0.2

2020-08-08 Thread Benas IML
> > > This is some new complexity, even if only a small amount right now. > My question remains about how much more added complexity it will > require later if we implement extensions like nested attributes. > What? Are you actually saying that 30 lines of code add "complexity"? I think you

[PHP-DEV] Re: Proposal: shorthand syntax for initializing arbitrary-precision("bigint") numbers?

2020-08-08 Thread Andrea Faulds
Hi Tyson, tyson andre wrote: What are your thoughts on making `123_456_000_000_000_000_000_000n` a shorthand for `gmp_init('12345600')` (or a call with equivalent results) (similar to existing backtick string syntax is a shorthand for `shell_exec()`) We could do that, but

Re: [PHP-DEV] Re: Proposal: shorthand syntax for initializing arbitrary-precision("bigint") numbers?

2020-08-08 Thread Rowan Tommins
On 08/08/2020 13:44, Andrea Faulds wrote: For example, what if we allowed string prefixes to have special user-defined meanings, like:   n"123_456" // expands to: gmp_init('123_456')   u"foo bar" // expands to: new UnicodeString("foo bar") (some class I made up)   d"123.456" // expands to:

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-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] Re: Proposal: shorthand syntax for initializing arbitrary-precision("bigint") numbers?

2020-08-08 Thread tyson andre
Hi Andrea, > > What are your thoughts on making `123_456_000_000_000_000_000_000n` a > > shorthand for `gmp_init('12345600')` (or a call with > > equivalent results) > > (similar to existing backtick string syntax is a shorthand for > > `shell_exec()`) > > We could do that,

Re: [PHP-DEV] Null-safe property access in interpolated strings

2020-08-08 Thread Marco Pivetta
On Sun, Aug 9, 2020, 00:17 Sara Golemon wrote: > Do we expect this to work? > > $foo = new stdClass; > $foo->bar = "Hello"; > echo "$foo?->bar world\n"; > > Because at the moment it doesn't: https://3v4l.org/nLv3l > > -Sara > Ooof, people still interpolate strings that way? Good riddance if it

Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC

2020-08-08 Thread Nikita Popov
On Fri, Jul 31, 2020 at 10:59 AM Ilija Tovilo wrote: > Hi internals > > > I started the vote on the nullsafe operator RFC. > > https://wiki.php.net/rfc/nullsafe_operator > > I'm happy to announce that the RFC was accepted with 56 votes in favor > and 2 votes against. Thanks to everybody who

Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC

2020-08-08 Thread Sara Golemon
On Sat, Aug 8, 2020 at 3:42 PM Ilija Tovilo wrote: > > > I just noticed that while we support "$a->b", we do not support > "$a?->b" (the quotes are relevant -- I'm talking about interpolated strings > here). That is, in the latter case the "?->b" is just treated like a string > part, not like a

Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC

2020-08-08 Thread Ilija Tovilo
Hi Nikita >> > I started the vote on the nullsafe operator RFC. >> > https://wiki.php.net/rfc/nullsafe_operator > > I just noticed that while we support "$a->b", we do not support "$a?->b" (the > quotes are relevant -- I'm talking about interpolated strings here). That is, > in the latter case

Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC

2020-08-08 Thread Ilija Tovilo
Hi again > > I just noticed that while we support "$a->b", we do not support "$a?->b" > > (the quotes are relevant -- I'm talking about interpolated strings here). > > That is, in the latter case the "?->b" is just treated like a string part, > > not like a property access. > > > > I don't

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.

[PHP-DEV] Null-safe property access in interpolated strings

2020-08-08 Thread Sara Golemon
Do we expect this to work? $foo = new stdClass; $foo->bar = "Hello"; echo "$foo?->bar world\n"; Because at the moment it doesn't: https://3v4l.org/nLv3l -Sara

Re: [PHP-DEV] Re: [VOTE] nullsafe operator RFC

2020-08-08 Thread tyson andre
Hi Ilija Tovilo, > > I just noticed that while we support "$a->b", we do not support "$a?->b" > > (the quotes are relevant -- I'm talking about interpolated strings here). > > That is, in the latter case the "?->b" is just treated like a string part, > > not like a property access. > > Just as I