note 6372 deleted from Returning values by torben

From: Date: Sat, 19 Aug 2000 22:46:17 +0000
Subject: note 6372 deleted from Returning values by torben
Groups: php.notes 
Request: Send a blank email to php-notes+get-2682@lists.php.net to get a copy of this message
To get multiple return values without using a list/array is to pass the return variables in as arguments: <pre>function MyFunc($myarg1, & $myreturn1, & my$return2){ $myreturn1 = $myarg1--; $myreturn2 = $myarg1++; }</pre> To use MyFunc(), do this: <pre>MyFunc( $mynumber, $previous_number, $next_number );</pre> I haven't done a full analysis on if/how this is hacky/elegant coding style, performance, overhead costs or anything like that. I just know this works. =)

« previous php.notes (#2682) next »