|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-12-06 12:57 UTC] richard dot heyes at heyes-computing dot net
<?php
function foo(&$bar){
return TRUE;
}
foo($bar);
print($bar);
if(!isset($bar))
print('Bar is not set!');
?>
With notices turned on (error_reporting) the call to print($bar) does not throw an error. However the bit below it runs the print() call. So if it's not set, the first print should throw an error regarding the unset $bar. Seems very contradictory. FWIW the type of $bar after the call to foo() is NULL.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jul 11 23:00:01 2026 UTC |
No idea. Though I do know of people who use that method to set variables, so their answer would be a resounding no. :) (EG: <?php function mconnect(&$link){ $link = mysql_connect(); } mconnect($db); ?> )