note 83430 deleted from function.end by bjori
| From: | bjori@php.net | Date: | Mon, 26 May 2008 11:35:28 +0000 |
| Subject: | note 83430 deleted from function.end by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139790@lists.php.net to get a copy of this message | ||
Note Submitter: sasha1rus at gmail dot com
Reason: bad code
----
Note that this function does not affect foreach loops. For example:
<?php
$a = array(1,2,3,4,5,6);
foreach ($a as $n)
{
echo $n . ' ';
if ($n == end($a))
{
echo 'End!';
}
}
?>
The output would be "1 2 3 4 5 6 End!", not "1 6 End!". Tested using php 5.2.5.