Spot the bug in the filter callback

from Array functions
PHP 8.3.33 intermediate 4 min 1 issue to find

Find why this filter does not inspect configuration keys as intended.

php
<?php
function publicConfig(array $config): array
{
    return array_filter(
        $config,
        fn(string $key): bool => str_starts_with($key, 'public_'),
        ARRAY_FILTER_USE_BOTH,
    );
}
Open in playground
Report an error