note 59088 added to language.variables
| From: | MikeatImmortalSoFardotcom at osu1 dot php dot net | Date: | Fri, 25 Nov 2005 22:03:14 +0000 |
| Subject: | note 59088 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99112@lists.php.net to get a copy of this message | ||
References and "return" can be flakey:
<?php
// This only returns a copy, despite the dereferencing in the function definition
function &GetLogin ()
{
return $_SESSION['Login'];
}
// This gives a syntax error
function &GetLogin ()
{
return &$_SESSION['Login'];
}
// This works
function &GetLogin ()
{
$ret = &$_SESSION['Login'];
return $ret;
}
?>
----
Manual Page -- http://www.php.net/manual/en/language.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59088
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59088&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59088&report=yes
Search -- http://master.php.net/manage/user-notes.php