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

2020-11-09 Thread Nuno Maduro
Agree with what has been said. We probably should leave this "alias" discussion to a near future where people would be able to create their own types like so: ```php type Number = Foo|Bar; ``` - Nuno On Mon, 9 Nov 2020 at 16:25, Sara Golemon wrote: > On Sun, Nov 8, 2020 at 11:09 AM Eugene

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

2020-11-09 Thread Sara Golemon
On Sun, Nov 8, 2020 at 11:09 AM Eugene Sidelnyk wrote: > What do you think about creating shorthand `number` for `int|float`? > Others have pointed at a few reasons why not, but I'd like to add that if we allow type aliasing, then projects can choose to define this or not. I'd rather see the

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] 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`?