I would like to add a function to PHP so I can use it in any script that runs on my server. Is it possible to register a function like if it was native from PHP? Does PHP has some kind of configuration file where I can register new global / native functions?
There is no intentions to use it in production, I’m just curious on how to achieve this.
You could use a “Global include” (defined in php.ini)
Read this (php.net manual)
auto-append-file and auto-prepend-file