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 $
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:
>
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(
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
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