0

I have scenario in my current work that requires overloading a method i.e having a method with the same name but different parameter requirement. And since i have done this in java, i was wondering if php have something like that.

Isaiahiroko
  • 994
  • 7
  • 12

1 Answers1

2

Unfortunately, not based on separate function declarations and parameters passed (like you see in Java). See here for a thorough explanation and alternatives:

PHP function overloading

Community
  • 1
  • 1
Kirk H
  • 441
  • 2
  • 6
  • In future, if this is the same question, please flag it as a duplicate instead of posting an answer that simply points there. – BoltClock May 20 '13 at 18:47