note 116497 added to function.return

From: Date: Tue, 13 Jan 2015 07:58:35 +0000
Subject: note 116497 added to function.return
Groups: php.notes 
Request: Send a blank email to php-notes+get-201418@lists.php.net to get a copy of this message
Also note, what you cannot do anything after the 'return' usage in function. For example: <?php $_SESSION['text'] = 'Best PHP'; function getText() { $text = $_SESSION['text']; return $text; unset($_SESSION['text']); } echo getText().'<br />'; echo $_SESSION['text']; ?> This will output: Best PHP Best PHP Twice, because we have used unset() function after 'return'. ---- Server IP: 72.52.91.14 Probable Submitter: 86.99.20.234 ---- Manual Page -- http://php.net/manual/en/function.return.php Edit -- https://master.php.net/note/edit/116497 Del: integrated -- https://master.php.net/note/delete/116497/integrated Del: useless -- https://master.php.net/note/delete/116497/useless Del: bad code -- https://master.php.net/note/delete/116497/bad+code Del: spam -- https://master.php.net/note/delete/116497/spam Del: non-english -- https://master.php.net/note/delete/116497/non-english Del: in docs -- https://master.php.net/note/delete/116497/in+docs Del: other reasons-- https://master.php.net/note/delete/116497 Reject -- https://master.php.net/note/reject/116497 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201418) next »