使用array_filter时出现意外的php通知和警告

I am getting the following

Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in C:\projects\yada.php on line 88

Warning: array_filter() expects at most 2 parameters, 3 given in C:\projects\yada.php on line 88

Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in C:\projects\yada.php on line 91

Warning: array_filter() expects at most 2 parameters, 3 given in C:\projects\yada.php on line 91

The code is as follows

$unregistered_team_names = array_filter($data, function ($v, $k) {
    return strpos($k, 'unregistered_user_name_') !== false;
}, ARRAY_FILTER_USE_BOTH);
$unregistered_team_emails = array_filter($data, function ($v, $k) {
    return strpos($k, 'unregistered_user_email_') !== false;
}, ARRAY_FILTER_USE_BOTH);

The code seems valid as per the documentation provided here - http://php.net/manual/en/function.array-filter.php

THe callback never gets called.

According to changelog section of array_filter manual:

5.6.0 Added optional flag parameter and constants ARRAY_FILTER_USE_KEY and ARRAY_FILTER_USE_BOTH

So, the answer is: your php version is lower than 5.6.