xref: /PHP-8.1/ext/standard/tests/array/bug69299.phpt (revision f8d79582)
1--TEST--
2Bug #69299 (Regression in array_filter's $flag argument in PHP 7)
3--FILE--
4<?php
5$toFilter = array('foo' => 'bar', 'fiz' => 'buz');
6$filtered = array_filter($toFilter, function ($value, $key) {
7    if ($value === 'buz'
8        || $key === 'foo'
9    ) {
10        return false;
11    }
12    return true;
13}, ARRAY_FILTER_USE_BOTH);
14var_dump($filtered);
15?>
16--EXPECT--
17array(0) {
18}
19