Problem/Motivation
PHP has opcode implementations for a subset of core functions, one of these is array_key_exists(), see #3346645: Eliminate anti-pattern isset($arr[$key]) || array_key_exists($key, $arr).
Drupal so far does not call PHP native functions like \array_key_exists()
, which means that PHP is unable to apply the opcode optimisation, since it needs to check for a function defined in the namespace first.
Steps to reproduce
Proposed resolution
Since the list of functions that have opcode implementations is subject to change, we should do this for all PHP native functions.
Beyond that, should we make this change only in namespaced code, or also in non-namespaced (procedural) code. It doesn't matter in procedural code, but it would be consistent and possibly help when code is copy and pasted around.