You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
def func_with_default_param(a, b = 2)
var_dump(a, b)
end
def variadic_func(a, ...b)
var_dump(a, b)
end
def typed_func(Foo a, FooBar b)
a.foo(b)
end
We've only had variadic functions since PHP 5.6, which came out this year. But default parameters and type hints have been around for a while. If you don't want to support types, then that's fair enough. We could actually give types different syntax to what PHP gives them, if we wanted.
The text was updated successfully, but these errors were encountered:
Uhm, types might get messy for now, but I do like default values. As for variadic functions, they are nice but PHP managed to stay away from them for quite some time so I don't think they are really required to implement right now.
Currently none of these work:
We've only had variadic functions since PHP 5.6, which came out this year. But default parameters and type hints have been around for a while. If you don't want to support types, then that's fair enough. We could actually give types different syntax to what PHP gives them, if we wanted.
The text was updated successfully, but these errors were encountered: