News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Davey Shafik's Blog:
Avoiding EVAL()
February 02, 2009 @ 11:15:24

Davey Shafik has a helpful hint for avoiding one of the worst functions to use in PHP - eval.

There are a shed-load of ways to "eval()" code without actually calling the eval() function '" usually done simply to avoid the use of the dreaded "evil()" function, but often times because the system has eval() disabled using "disable_functions" in php.ini. Here is another simple way to avoid eval() without writing out files to the filesystem

His example uses the streams wrapper to natively execute the code from a string variable as a data element, base64 decoded. It's more of a proof-of-concept than anything else, but its an interesting solution to a tough problem to solve at times.

0 comments voice your opinion now!
eval evil avoid streams wrapper data base64 execute


blog comments powered by Disqus

Similar Posts

Michael Nitschinger: A Journey on Avoiding Nulls in PHP

DevShed: Iterators in the Simplest Sense - Traversing Data Structures in PHP 5

Jonathan Snook's Blog: CakePHP: Setting Default Values

Sebastian Bergmann's Blog: Isolated (and Parallel) Test Execution

Hasin Hayder's Blog: Using new PECL Memcached extension for storing session data


Community Events

Don't see your event here?
Let us know!


opinion introduction series interview unittest extension api library laravel community laravel5 symfony release voicesoftheelephpant threedevsandamaybe security language framework version podcast

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework