Yes, that is exactly the behavior expected by defining define( ‘GENERATE_HOOKS_DISALLOW_PHP’, true );
in wp-config – the execution of php in hooks is prevented then. 🙂
So what exactly was your concern? Why did you want to make this entry?
Maybe this reading this entry will help you:
Disallow PHP Execution
However, if you just want to hide the red admin hint, then paste the following code into your child theme’s functions.php:
add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
remove_action( 'admin_notices','generate_hooks_php_check' );
}