3 ms·
Because php has no function overloading by type system.
by tpetry 7y ago
Because php has no function overloading by type system.
- kristopolous 7y agoThe type can trivially be checked inside the function. You don't need type system function overloading
- totony 7y agobut this has runtime cost, where inconsistent order doesn't
- kristopolous 7y agoNot necessarily. Unless someone is intentionally trying to be confusing, the parameter order will be consistent for a specific instantiation. I mean that if it's array,function at line X this time, it will be next time - again, unless you are trying to intentionally break this rule through a coding acrobatics exercise. Since it's now known (with relative confidence), it can be optimized. If someone truly is doing wacky things then we are left exactly where we were beforehand, with a broken system. Most of the time, however, it'd be better