Bug #71240 [NEW]: array_filter byref value in callable no longer working
| From: | donatj at gmail dot com | Date: | Tue, 29 Dec 2015 20:05:13 +0000 |
| Subject: | Bug #71240 [NEW]: array_filter byref value in callable no longer working | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-198287@lists.php.net to get a copy of this message | ||
From: donatj at gmail dot com
Operating system:
PHP version: 7.0.1
Package: *General Issues
Bug Type: Bug
Bug description:array_filter byref value in callable no longer working
Description:
------------
It would appear that passing by reference in the callable of
array_filter no longer functions as expected. I can find no
documentation of this change on the array_filter page.
The expected result is seen in 5.3 -> 5.6
Test script:
---------------
<?php
$files = array('AAA', 'BBB', 'CcC');
$files = array_filter($files, function ( &$path ) {
$path = strtolower($path);
return true;
});
print_r($files);
Expected result:
----------------
Array
(
[0] => aaa
[1] => bbb
[2] => ccc
)
Actual result:
--------------
Array
(
[0] => AAA
[1] => BBB
[2] => CcC
)
--
Edit bug report at https://bugs.php.net/bug.php?id=71240&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71240&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71240&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71240&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71240&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71240&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71240&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71240&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71240&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71240&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71240&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71240&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71240&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71240&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71240&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71240&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71240&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71240&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71240&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71240&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71240&r=mysqlcfg