PHP : override_function doesn't override even if bool true is returned
问题 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