[PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-14 Thread Matthew Brown
Hey all, Is there interest in prohibiting whitespace around double colons in the next major PHP version? I was surprised to learn that PHP treats :: similar to ->, allowing double colons like A:: b(); Looking at the top 2,000 packages in Packagist I can't find any evidence of people using a dou

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-14 Thread Stephen Reay
> On 15 Feb 2021, at 12:14, Matthew Brown wrote: > > Hey all, > > Is there interest in prohibiting whitespace around double colons in the > next major PHP version? > > I was surprised to learn that PHP treats :: similar to ->, allowing double > colons like > > A:: > b(); > > Looking at the

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-14 Thread Andreas Heigl
Hey Matt. Am 15.02.21 um 06:14 schrieb Matthew Brown: > Hey all, > > Is there interest in prohibiting whitespace around double colons in the > next major PHP version? > > I was surprised to learn that PHP treats :: similar to ->, allowing double > colons like > > A:: > b(); > > Looking at the

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Matthew Brown
There are plenty of places where PHP doesn't allow whitespace currently. The most comparable example is between namespace separators: Ns \ bar(); Ns \ SOME_CONST; are both syntax errors. `MyClass::bar()` and `MyClass::SOME_CONST` are often used in place of `Ns\bar()` and `Ns\SOME_CONST` because

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Sara Golemon
On Mon, Feb 15, 2021 at 8:53 AM Matthew Brown wrote: > > There are plenty of places where PHP doesn't allow whitespace currently. > > The most comparable example is between namespace separators: > > Ns \ bar(); > Ns \ SOME_CONST; > That change was made very recently (8.0) and was done for technic

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Matthew Brown
On Mon, 15 Feb 2021 at 11:05, Sara Golemon wrote: > That change was made very recently (8.0) and was done for technical > reasons (attributes) not aesthetic ones. > > Personally, I agree that adding whitespace around double colon is a > suspect move, but breaking valid code for the sake of one's

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Rowan Tommins
On 15/02/2021 14:52, Matthew Brown wrote: The most comparable example is between namespace separators: Ns \ bar(); Ns \ SOME_CONST; are both syntax errors. As Sara says, this only became an error in 8.0, and there was a rather specific reason for it, but I think there is a philosophical dif

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Matthew Brown
Thanks, now I realise I was probably wrong to bring this up. I had it in my mind that "::" could never appear chained together (thinking of constants), but it's just that I've never seen code that chains them together – i.e. this is valid: A::b()::c()::$d::$e = 5; On Mon, 15 Feb 2021 at 15:06,

Re: [PHP-DEV] Whitespace around Paamayim Nekudotayim (double colon)

2021-02-15 Thread Larry Garfield
On Mon, Feb 15, 2021, at 2:25 PM, Matthew Brown wrote: > Thanks, now I realise I was probably wrong to bring this up. > > I had it in my mind that "::" could never appear chained together (thinking > of constants), but it's just that I've never seen code that chains them > together – i.e. this is