I'm using the ovverride_function installed from apd.so library via pecl
It doesn't seem to work as expected
This is my script
function my_require($path) {
echo "HELLO\n";
echo $path;
}
$b = override_function('require', '$path', 'return my_require($path);');
var_dump($b);
require './index.php';
What I expected was to see as output
bool(true)
HELLO
./index.php
Instead I got
bool(true)
Warning: require(./index.php): failed to open stream: No such file or directory in /var/www/test/script/test.php on line 14
So even if the function seemed to work (bool true) the require function still acts as the old one.
Any idea?