Re: Pass by reference (5.1.1 vs 5.1.2)

From: Date: Mon, 24 Jul 2006 19:02:40 +0000
Subject: Re: Pass by reference (5.1.1 vs 5.1.2)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-24947@lists.php.net to get a copy of this message
in that case, the documentation on socket_select() needs to be edited: http://www.php.net/socket-select says: <?php /* Prepare the read array */ $read = array($socket1, $socket2); $num_changed_sockets = socket_select($read, $write = NULL, $except = NULL, 0); if ($num_changed_sockets === false) { /* Error handling */ } else if ($num_changed_sockets > 0) { /* At least at one of the sockets something interesting happened */ } ?> according to you, $write and $except could be undefined, right? - Ron "Johannes Schlueter" <johannes@php.net> wrote in message news:200607241916.27024.johannes@php.net... > 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

« previous php.internals (#24947) next »