Bug #74724 [Com]: each bug?
| From: | sjon at hortensius dot net | Date: | Fri, 09 Jun 2017 08:00:11 +0000 |
| Subject: | Bug #74724 [Com]: each bug? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209438@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74724&edit=1
ID: 74724
Comment by: sjon at hortensius dot net
Reported by: tell dot a dot name dot to dot me at gmail dot com
Summary: each bug?
Status: Open
Type: Bug
Package: *General Issues
Operating System: win/linux
PHP Version: 7.1.6
Block user comment: N
Private report: N
New Comment:
Looking at https://3v4l.org/dGZbf the reporter considers the
difference between php5 & php7 to be a bug
However, I think this is caused by the changes made for https://wiki.php.net/rfc/php7_foreach The
documentation could be updated; but each is already marked as deprecated
Previous Comments:
------------------------------------------------------------------------
[2017-06-09 06:07:38] tell dot a dot name dot to dot me at gmail dot com
Description:
------------
<?php
$arr = ['a', 'b', 'c'];
var_dump(current($arr));
echo '--------aaaaaa--------', PHP_EOL;
var_dump(end($arr));
var_dump(next($arr));
$abc = $arr;
echo '--------bbbbbbb--------', PHP_EOL;
var_dump(current($abc)); // false
var_dump(current($abc)); // false
var_dump(each($abc)); // not false???
var_dump(each($abc)); // not false???
var_dump(each($abc)); // not false???
echo '--------cccccccc--------', PHP_EOL;
Test script:
---------------
<?php
$arr = ['a', 'b', 'c'];
var_dump(current($arr));
echo '--------aaaaaa--------', PHP_EOL;
var_dump(end($arr));
var_dump(next($arr));
$abc = $arr;
echo '--------bbbbbbb--------', PHP_EOL;
var_dump(current($abc)); // false
var_dump(current($abc)); // false
var_dump(each($abc)); // not false???
var_dump(each($abc)); // not false???
var_dump(each($abc)); // not false???
echo '--------cccccccc--------', PHP_EOL;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74724&edit=1