Php: defaulting optional param performance -


in php, there difference in performance if calling function fills in optional parameters (with respective defaults), or leave them blank?

for example:

function foo($id, $a = '', $b = false) { ..... } 

which faster:

foo(1234); 

or

foo(1234, '', false); 

it doesn't matter far speed, helps out readability , code duplication. setting defaults means, don't have set same values in multiple places in code stack means readability , consistency!


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -