什麼不對這個代碼:語法錯誤,意想不到的EVAL「=」()'d代碼
<?php eval(" $start = microtime(true)*1000; echo 'hello'; $end=microtime(true)*1000; $time = $end-$start; $time = round($time,4); echo '<br />Time taken: '.$time.'ms<br />'; "); ?>
這正是一行代碼(不要問爲什麼),但readablility我重複
<?php
eval(" $start = microtime(true)*1000;
echo 'hello';
$end=microtime(true)*1000;
$time = $end-$start;
$time = round($time,4);
echo '<br />Time taken: '.$time.'ms<br />';
");
?>
我得到這個錯誤: Parse error: syntax error, unexpected '=' in ...\test2.php(1) : eval()'d code on line 1
爲什麼地球上,你做的一切都是在'的eval()'聲明? – Eric
我有一個理由,它是更大的一部分。 – Dharman
刪除'eval()',它可以正常工作:http://codepad.org/HlnP46j9 – Eric