We have a function that is being defined on a host but not locally which is causing a name collision. The function is go()
and it's in Kirby and somewhere else. When we deploy to Vercel we get an error saying go()
is already defined. This is not an issue locally or on other hosts (we tried Dreamhost as an example).
We tried this to find where the original is called:
$reflFunc = new ReflectionFunction('function_name');
print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();
But we get literally: :
As if it's not defined. If we wrap the function in if (!function_exists('go'))
it does break for other reasons but the redeclaration error is alleviated so we know the function exists but we can't find it.
In JavaScript you can do like console.log(someFunction)
and it'll output the function in string form. Example:
Can we do this in PHP? This would allow us to try to at least search for the code signature in the project or on the web to find what code is colliding.