[UPHPU] pass variables into a function

Wade Preston Shearer wadeshearer.lists at me.com
Fri Jan 9 12:44:35 MST 2009


Consider the following code:

function do_something_awesome($a = 'a', $b = 'b') {}


I have set defaults for the variables that the function accepts. I can  
override the defaults, like this:

do_something_awesome('c', 'd');


…or…

$a = 'c';
$b = 'd';
do_something_awesome($a, $b);


And, I can passing in the first while letting the second use the  
default, like this:

do_something_awesome('c');


But what if I only want to pass in the second variable? Is that  
possible?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2431 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20090109/6bf61988/smime.bin


More information about the UPHPU mailing list