3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { protected static $array = ['a', 'b', 'c']; protected static function getArray() { return $array; } public static function test($testArray) { return array_key_intersect($testArray, array_flip(self::getArray())); } } print_r(Test::test(['a' => 2]));

preferences:
38.23 ms | 402 KiB | 5 Q