Re: [PHP-DEV] Re: PHP 8: Method Overloading, The Ressurection

2019-02-03 Thread Cees-Jan Kiewiet
Well there should be a: overload function sum(float $b, float $b): float; in that case or throw an error for no matching function available imho. On Sun, Feb 3, 2019 at 8:00 PM Christoph M. Becker wrote: > On 03.02.2019 at 19:39, David Rodrigues wrote: > > > overload function sum(int $a, int $

Re: [PHP-DEV] Re: PHP 8: Method Overloading, The Ressurection

2019-02-03 Thread Marcos Passos
I believe we can adopt the behaviour of mature languages that supports this feature. Java, for instance, throw a compile-time error saying that the method signature is ambiguous. On Sun, Feb 3, 2019 at 17:51 David Rodrigues wrote: > Em dom, 3 de fev de 2019 às 17:19, Rowan Collins > escreveu: >

Re: [PHP-DEV] Re: PHP 8: Method Overloading, The Ressurection

2019-02-03 Thread David Rodrigues
Em dom, 3 de fev de 2019 às 17:19, Rowan Collins escreveu: > On 03/02/2019 19:00, Christoph M. Becker wrote: > > On 03.02.2019 at 19:39, David Rodrigues wrote: > > > >> overload function sum(int $a, int $b): int; > >> overload function sum(float $b, float $b): float; > > Which function would sum(

Re: [PHP-DEV] Re: PHP 8: Method Overloading, The Ressurection

2019-02-03 Thread Rowan Collins
On 03/02/2019 19:00, Christoph M. Becker wrote: On 03.02.2019 at 19:39, David Rodrigues wrote: overload function sum(int $a, int $b): int; overload function sum(float $b, float $b): float; Which function would sum(17.4, 42) call? Also consider: sum(PHP_INT_MAX, PHP_INT_MAX) vs. sum(P

[PHP-DEV] Re: PHP 8: Method Overloading, The Ressurection

2019-02-03 Thread Christoph M. Becker
On 03.02.2019 at 19:39, David Rodrigues wrote: > overload function sum(int $a, int $b): int; > overload function sum(float $b, float $b): float; Which function would sum(17.4, 42) call? Also consider: sum(PHP_INT_MAX, PHP_INT_MAX) vs. sum(PHP_INT_MAX+1, PHP_INT_MAX+1) -- Christoph M. Be