note 81139 added to function.constant

From: Date: Fri, 15 Feb 2008 11:34:07 +0000
Subject: note 81139 added to function.constant
Groups: php.notes 
Request: Send a blank email to php-notes+get-136168@lists.php.net to get a copy of this message
To use constants in functions additional its not neccessary to change the function call wherever you need the constant in a function. foo($var1); to foo($var1,$const); More easy is to change the function definition and use a default value for a new variable that contains the const value. function foo($var1,$my_const=CONST_VALUE){ if($my_const==1) dosomething(); } Now it`s not necessary to change the function call wherever you need the function. ---- Server IP: 217.13.201.10 Probable Submitter: 85.176.14.214 ---- Manual Page -- http://www.php.net/manual/en/function.constant.php Edit -- https://master.php.net/note/edit/81139 Del: integrated -- https://master.php.net/note/delete/81139/integrated Del: useless -- https://master.php.net/note/delete/81139/useless Del: bad code -- https://master.php.net/note/delete/81139/bad+code Del: spam -- https://master.php.net/note/delete/81139/spam Del: non-english -- https://master.php.net/note/delete/81139/non-english Del: in docs -- https://master.php.net/note/delete/81139/in+docs Del: other reasons-- https://master.php.net/note/delete/81139 Reject -- https://master.php.net/note/reject/81139 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136168) next »