MDL-79890 core: Add polyfill for array_keys with filter
commit0efbc79e5f16efb665ae6f2a8c07e87a9c064533
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 7 Nov 2023 07:53:21 +0000 (7 15:53 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 15 Nov 2023 01:14:40 +0000 (15 09:14 +0800)
treefc069f318765cbfe030fe111b6d95c1501cfab36
parente734858e55ebd201ea96b886b0d3ea51b90d40e7
MDL-79890 core: Add polyfill for array_keys with filter

This is a Moodle version of a proposed function `array_keys_filter`.

Since this method has not yet been created in upstream PHP, I have
elected to name it with a Moodle prefix as the signature is not known.

In the future, if and when this method is created, we can replace its
content with new method and deprecate it.
lib/moodlelib.php
lib/tests/moodlelib_test.php