Re: [PHP-DEV] [RFC] Support for ::function syntax

2020-11-07 Thread Larry Garfield
On Sat, Nov 7, 2020, at 5:41 PM, a...@php.net wrote: > Hello internals, > > Looking for feedback on the idea of supporting `::function` syntax (or > `::fn`) for consistency with existing `::class` syntax: > > $arr = ['apple']; > print_r(array_map(strtoupper::function, $arr)); > > (Apolog

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Larry Garfield
On Sat, Nov 7, 2020, at 2:47 PM, Sara Golemon wrote: > On Sat, Nov 7, 2020 at 9:33 AM Olle Härstedt wrote: > > > 2020-11-07 15:12 GMT, Eugene Sidelnyk : > > > function foo(A & B & E $object) { > > > // some work > > > var_dump($object); > > > } > > > > > > > You mean intersections? Psalm supp

[PHP-DEV] [RFC] Support for ::function syntax

2020-11-07 Thread as
Hello internals, Looking for feedback on the idea of supporting `::function` syntax (or `::fn`) for consistency with existing `::class` syntax: $arr = ['apple']; print_r(array_map(strtoupper::function, $arr)); (Apologies if this has already been discussed. Hard to search for colon-colon-

Re: [PHP-DEV] php-src Git hash abbreviation collisions

2020-11-07 Thread Sara Golemon
On Sat, Nov 7, 2020 at 5:14 AM Christoph M. Becker wrote: > I've just noticed a pull request[1] which suggests to no longer > abbreviate the php-src Git hashes to 7 digits only, because there are > already collisions. Using 10 digits as suggested seems reasonable to > me, but I wanted to check i

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Sara Golemon
On Sat, Nov 7, 2020 at 9:33 AM Olle Härstedt wrote: > 2020-11-07 15:12 GMT, Eugene Sidelnyk : > > function foo(A & B & E $object) { > > // some work > > var_dump($object); > > } > > > > You mean intersections? Psalm supports this notation. > > IIRC we discussed intersection data types when un

Re: [PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Sara Golemon
On Sat, Nov 7, 2020 at 3:09 AM Nikita Popov wrote: > The PhpToken::getAll() API introduced in PHP 8.0 is of course inspired by > the existing token_get_all() function. But arguably, the name is not that > great. > > The reporter suggests to rename it into PhpToken::tokenize() instead, which > see

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Olle Härstedt
https://wiki.php.net/rfc/intersection_types 2020-11-07 16:37 GMT+01:00, Eugene Sidelnyk : > Yes. > And I think it will be good if enforced by language. > > On Sat, Nov 7, 2020, 5:33 PM Olle Härstedt wrote: > >> 2020-11-07 15:12 GMT, Eugene Sidelnyk : >> > When you follow ISP, you probably would h

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Eugene Sidelnyk
Yes. And I think it will be good if enforced by language. On Sat, Nov 7, 2020, 5:33 PM Olle Härstedt wrote: > 2020-11-07 15:12 GMT, Eugene Sidelnyk : > > When you follow ISP, you probably would have a lot of interfaces. > > Thus, client code may require an object to implement a bunch of > interf

Re: [PHP-DEV] Union `&` operator

2020-11-07 Thread Olle Härstedt
2020-11-07 15:12 GMT, Eugene Sidelnyk : > When you follow ISP, you probably would have a lot of interfaces. > Thus, client code may require an object to implement a bunch of interfaces > depending on functionality needed. > > Consider class `Bar`: > > ```php > > interface A {} > > interface B {} >

[PHP-DEV] Union `&` operator

2020-11-07 Thread Eugene Sidelnyk
When you follow ISP, you probably would have a lot of interfaces. Thus, client code may require an object to implement a bunch of interfaces depending on functionality needed. Consider class `Bar`: ```php interface A {} interface B {} interface C {} interface D {} interface E {} class Bar i

Re: [PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Gabriel Caruso
On Sat, Nov 7, 2020, 10:10 Nikita Popov wrote: > Hi internals, > > Cross-posting from https://bugs.php.net/bug.php?id=80328 to a place where > someone might see it... > > The PhpToken::getAll() API introduced in PHP 8.0 is of course inspired by > the existing token_get_all() function. But arguabl

[PHP-DEV] php-src Git hash abbreviation collisions

2020-11-07 Thread Christoph M. Becker
Hi all, I've just noticed a pull request[1] which suggests to no longer abbreviate the php-src Git hashes to 7 digits only, because there are already collisions. Using 10 digits as suggested seems reasonable to me, but I wanted to check if there are other places affected than the RM tools. So, i

Re: [PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Sebastian Bergmann
Am 07.11.2020 um 10:09 schrieb Nikita Popov: The reporter suggests to rename it into PhpToken::tokenize() instead, which seems like a sensible suggestion to me. +1 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Hans Henrik Bergan
+1 for ::tokenize() -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

[PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Nikita Popov
Hi internals, Cross-posting from https://bugs.php.net/bug.php?id=80328 to a place where someone might see it... The PhpToken::getAll() API introduced in PHP 8.0 is of course inspired by the existing token_get_all() function. But arguably, the name is not that great. The reporter suggests to rena

Re: [PHP-DEV][RFC] Add support for explicit octal notation for integer literals

2020-11-07 Thread G. P. B.
Hello internals, As the 2 week discussion period has passed I intend to open voting on Tuesday the 10th of November. I did a bit of rewording on the RFC but it is fundamentally identical: https://wiki.php.net/rfc/explicit_octal_notation Any remaining concerns, clarifications and/or questions sho