Re: Pass by reference (5.1.1 vs 5.1.2)
| From: | Johannes Schlueter | Date: | Mon, 24 Jul 2006 17:16:26 +0000 |
| Subject: | Re: Pass by reference (5.1.1 vs 5.1.2) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24939@lists.php.net to get a copy of this message | ||
Hi,
On Monday 24 July 2006 17:52, Rishad Omar wrote:
> getArray($p = array());
Here you are relying on undefined behavior. It is not defined wether $p =
array() or the function call getarray($p) should be executed first so the
order might always change.
You should always use the two lines
$p = array();
getArray($p);
to be safe.
johannes