note 116642 modified in function.eval by salathe
| From: | salathe@php.net | Date: | Fri, 06 Feb 2015 13:38:46 +0000 |
| Subject: | note 116642 modified in function.eval by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201645@lists.php.net to get a copy of this message | ||
For them who are facing syntax error when try execute code in eval,
<?php
$str = '<?php echo "test"; ?>';
eval('?>'.$str.'<?php;'); // outputs test
eval('?>'.$str.'<?'); // outputs test
eval('?>'.$str.'<?php');// throws syntax error - unexpected $end
?>
--was--
For them who are facing syntax error when try execute code in eval,
$str = '<?php echo "test"; ?>';
eval('?>'.$str.'<?php;'); // outputs test
eval('?>'.$str.'<?'); // outputs test
eval('?>'.$str.'<?php');// throws syntax error - unexpected $end
http://php.net/manual/en/function.eval.php