如何在不转到php.ini文件的情况下禁用eval函数?

Is there a way to disable eval function without doing so from php.ini file. I have tried ini_set function but even that doesn't work.

Basically I want my framework users to decide whether this function should be enabled or not through a config file. If they say no, i should be able to disable it using code as i can't go to server of each users where my framework is installed and disabling it using php.ini file.

As i said without goint to php.ini file, so ini directive disable_functions should not be posted in answers.

Please help.

It won't work, because eval() is not a function - it's a language construct. You can disable it with suhosin, a protection system for PHP. That's the only way I know of.

From PHP.net:

Note: Because this is a language construct and not a function,
it cannot be called using variable functions 

if this is mod_php (not CGI) with apache, .htaccess will work. other than that... bad luck.

I guess you could call override_function with a new function which does nothing. (req APD)

https://github.com/mk-j/PHP_diseval_extension allows you to disable eval in php7 as well as php5. Suhosin is only stable in php5.