PHP function overloading

前端 未结 10 977
北恋
北恋 2020-11-22 17:24

Coming from C++ background ;)
How can I overload PHP functions?

One function definition if there are any arguments, and another if there are no arguments? Is it

10条回答
  •  一整个雨季
    2020-11-22 17:49

    PHP does not support overloading for now. Hope this will be implemented in the other versions like other programming languages.

    Checkout this library, This will allow you to use PHP Overloading in terms of closures. https://github.com/Sahil-Gulati/Overloading

提交回复
热议问题