SolvedPHP CS Fixer Add a rule to root-namespace special compiled PHP functions

Since PHP 7.0, some functions are replaced by opcodes, producing much faster code.
Yet, for this to work, these functions need to be referenced in the root namespace at compile time:
Either there is no namespace, or they are prefixed by a \.
php-cs-fixer should have a rule to list those functions and enforce adding this \ when used inside a namespaced file/class.

Here is the exact list of functions that have this behavior:

(don't miss #3048 (comment))

24 Answers

✔️Accepted Answer



More Issues: