Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Alexandru Pătrănescu
On Sat, Oct 2, 2021 at 6:07 PM G. P. B. wrote: > Hello internals, > > I'm proposing a new RFC to make 'null' usable as a standalone type. > > RFC: https://wiki.php.net/rfc/null-standalone-type > GitHub PR: https://github.com/php/php-src/pull/7546 > > Best regards, > > George P. Banyard > Hey Geo

Re: [PHP-DEV] Function list declaration syntax?

2021-10-05 Thread Dan Ackroyd
On Tue, 5 Oct 2021 at 18:47, Mike Schinkel wrote: > Consider the `Type` class[3] in the `SebastianBergmann\Type` namespace. It > contains 60 lines of function declaration to define 14 functions that all > return `false`. PHP allows you to define functions on one line: function isCallable(

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread David Gebler
On Tue, Oct 5, 2021 at 3:45 PM Nikita Popov wrote: > On Tue, Oct 5, 2021 at 4:08 PM Côme Chilliet wrote: > > > Le lundi 4 octobre 2021, 10:09:12 CEST Nikita Popov a écrit : > > > If we make this change, I would however suggest to also support "false" > > as > > > a standalone type. I think this

[PHP-DEV] Function list declaration syntax?

2021-10-05 Thread Mike Schinkel
Hi all, This email proposes a shorthand syntax for declaring a list of single-expression functions. A similar albeit more verbose attempt to provide short functions[1] failed late last year, but I was recently inspired by Sebastian Bergmann's Type library[2] that he referenced in a comment on

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Mike Schinkel
> On Oct 2, 2021, at 11:06 AM, G. P. B. wrote: > > Hello internals, > > I'm proposing a new RFC to make 'null' usable as a standalone type. > > RFC: https://wiki.php.net/rfc/null-standalone-type Regarding the RFC's proposed disallowing of `?null`, is that really needed? Obviously it doesn't m

Re: [PHP-DEV] Unbreak git.php.net links?

2021-10-05 Thread Hans Henrik Bergan
@Ayesh thanks, added support for those url ( https://github.com/divinity76/git-php-net-redirector/commit/072a579d140a7481e76e95bd8c2d120ee2f71565 ), also it looks like version numbers got mixed up in your example #2 , "8.0.0RC2" vs "8.1.0RC3", that is surely a typo? >It is the name of the git repo

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Lynn
On Tue, Oct 5, 2021 at 4:08 PM Côme Chilliet wrote: > > Why would function a(): null|false {} be legal but function b(): null|0 > would not? > > This is inconsistent to me. And adding null, then false, then true for the > sake of completeness feels like avoiding to treat the static value as type

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Nikita Popov
On Tue, Oct 5, 2021 at 4:08 PM Côme Chilliet wrote: > Le lundi 4 octobre 2021, 10:09:12 CEST Nikita Popov a écrit : > > If we make this change, I would however suggest to also support "false" > as > > a standalone type. I think this change primarily has benefits from a > > typesystem completeness

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Levi Morrison via internals
On Tue, Oct 5, 2021 at 8:08 AM Côme Chilliet wrote: > > Le lundi 4 octobre 2021, 10:09:12 CEST Nikita Popov a écrit : > > If we make this change, I would however suggest to also support "false" as > > a standalone type. I think this change primarily has benefits from a > > typesystem completeness

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Côme Chilliet
Le lundi 4 octobre 2021, 10:09:12 CEST Nikita Popov a écrit : > If we make this change, I would however suggest to also support "false" as > a standalone type. I think this change primarily has benefits from a > typesystem completeness perspective rather than a strong practical need. > From that an

Re: [PHP-DEV] Unbreak git.php.net links?

2021-10-05 Thread Ayesh Karunaratne
> here is an initial implementation: > https://github.com/divinity76/git-php-net-redirector/blob/main/src/redirector.php > it is just a minimum-effort implementation, anyone feel free to make > something better (also i have no idea how the "p" argument is supposed to > be parsed, so i just guessed)

Re: [PHP-DEV] Adding `final class Deque` to PHP

2021-10-05 Thread Nikita Popov
On Tue, Oct 5, 2021 at 12:47 AM tyson andre wrote: > Hi Nikita Popov, > > > 1. There would be the possibility of having an interface Deque that is > > backed by a VecDeque/ArrayDeque implementation. I'm not convinced this > > would actually make sense, but I wanted to throw it out there, given th