Re: [PHP-DEV] Alias for `int|float`

2020-11-08 Thread Christoph M. Becker
On 08.11.2020 at 18:26, Reindl Harald (privat) wrote: > Am 08.11.20 um 18:09 schrieb Eugene Sidelnyk: >> >> What do you think about creating shorthand `number` for `int|float`? If at all, it should be called `numeric`, because that is a reserved word as of PHP 7.0.0:

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

2020-11-08 Thread Rowan Tommins
On 08/11/2020 02:12, Larry Garfield wrote: There was some discussion earlier this year, although if memory serves it was in a thread whose name would not be helpful for searching. Here it is: https://externals.io/message/108459 Some of the key points (not an exhaustive summary): - Looking

Re: [PHP-DEV] Alias for `int|float`

2020-11-08 Thread Benas IML
...and introducing 'number' would also be a huge BC break (even in our codebase there's a class named 'Number'). Best regards, Benas On Sun, Nov 8, 2020, 7:26 PM Reindl Harald (privat) wrote: > > > Am 08.11.20 um 18:09 schrieb Eugene Sidelnyk: > > Hello, internals! > > > > What do you think

Re: [PHP-DEV] Alias for `int|float`

2020-11-08 Thread Reindl Harald (privat)
Am 08.11.20 um 18:09 schrieb Eugene Sidelnyk: Hello, internals! What do you think about creating shorthand `number` for `int|float`? nothing because: a) float accepts int anyways b) overloading the engine for each and every nuance is not helpful c) union types are clear and readable --

[PHP-DEV] Alias for `int|float`

2020-11-08 Thread Eugene Sidelnyk
Hello, internals! What do you think about creating shorthand `number` for `int|float`?

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

2020-11-08 Thread Eugene Sidelnyk
> As for when to allow them: as others have suggested in this thread, keep it simple for now, and only allow intersection of class/interface references. Yes, I think that single intersection type should support just one class and any/or any number of interfaces with the condition that they don't

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

2020-11-08 Thread Eugene Sidelnyk
> 1. Do we support complex types combining unions with intersections? We can do it at any time, so we should not hurry with this. If we think about why people would like to do such complex types - probably it is because PHP currently doesn't support methods overloading. Thus we'd rather

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

2020-11-08 Thread Marco Pivetta
Hey Eugene, On Sat, Nov 7, 2020 at 4:13 PM Eugene Sidelnyk wrote: > ```php > function foo(A & B & E $object) { > // some work > > var_dump($object); > } > ``` > Fully support this for parameter, property and return types: already making good use of intersection types since a few years. As

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

2020-11-08 Thread Marco Pivetta
Hey Michael, On Sun, Nov 8, 2020 at 9:38 AM Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > Hi, > > what about resolving directly to Closure? > > strtoupper::function === \Closure::fromCallable('strtoupper'). > > $this->method::function ===

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

2020-11-08 Thread Michael Voříšek - ČVUT FEL
Hi, what about resolving directly to Closure? strtoupper::function === \Closure::fromCallable('strtoupper'). $this->method::function === \Closure::fromCallable([$this, 'method']). With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 8 Nov 2020 00:41,