Open olivernybroe opened 5 years ago
Basically the support for having multiple methods named the same but with different parameters. For example, this would be really helpful in the Laravel Query builder, where if we look at the where method for example, it is full of if statements to call the correct method. If we had method overloading, this would simply be multiple methods, taking the correct argument in each of the methods. https://github.com/laravel/framework/blob/2906b572aa83ff46b8ad57093dd0e859c0ff783f/src/Illuminate/Database/Query/Builder.php#L487-L548
+1, pattern matching/method overloading makes some code so much more elegant.
Basically the support for having multiple methods named the same but with different parameters. For example, this would be really helpful in the Laravel Query builder, where if we look at the where method for example, it is full of if statements to call the correct method. If we had method overloading, this would simply be multiple methods, taking the correct argument in each of the methods. https://github.com/laravel/framework/blob/2906b572aa83ff46b8ad57093dd0e859c0ff783f/src/Illuminate/Database/Query/Builder.php#L487-L548