note 93035 deleted from language.references.pass by mazzanet

From: Date: Thu, 20 Aug 2009 13:36:14 +0000
Subject: note 93035 deleted from language.references.pass by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159692@lists.php.net to get a copy of this message
Note Submitter: justin at ilithium dot com ---- There appears to be no information on how to handle optional pass-by-parameters so I'm posting an example, in which these optional values are defaulted to NULL, as follows: function test_ref ($a, $b = NULL) { if (is_null($b) === false) { $b = "Value set"; return; } print "No value set"; } test without parameter: { $a = "test"; test_ref($a); } outputs: No value set test with parameter: { $a = "test"; $b = "test"; test_ref($a, $b); print $b; } outputs: Value set

« previous php.notes (#159692) next »