[PHP-BUG] Bug #71240 [NEW]: array_filter byref value in callable no longer working

[email protected] ("donatj at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.