Does eval REALLY works???
Posted: Tue Dec 08, 2009 4:31 pm
I am working on a small obfuscation script using eval as the main engine. Everything was doing fine when I bumped to a problem. Look at the following code:
Instead to run the code, it spits out the following error message:
Parse error: parse error, unexpected $end in c:\www\apache\htdocs\bcs_eval\wtf.php(6) : eval()'d code on line 1
Why doesn't eval evaluate it??? Any idea?

Code: Select all
<?php
$dollar = "\$";
eval ("for($dollar"."z=0;".$dollar."z<=10000;".$dollar."z++".")");
?>
Parse error: parse error, unexpected $end in c:\www\apache\htdocs\bcs_eval\wtf.php(6) : eval()'d code on line 1
Why doesn't eval evaluate it??? Any idea?