#36758 [Opn->Bgs]: eval not behaving like in documantation
| From: | mike@php.net | Date: | Thu, 16 Mar 2006 11:12:42 +0000 |
| Subject: | #36758 [Opn->Bgs]: eval not behaving like in documantation | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969372396@lists.php.net to get a copy of this message | ||
ID: 36758
Updated by: mike@php.net
Reported By: khan dot shadow at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Then don't use the echo statement.
Previous Comments:
------------------------------------------------------------------------
[2006-03-16 12:00:53] khan dot shadow at gmail dot com
Description:
------------
" In case of a parse error in the evaluated code, eval() returns FALSE.
In case of a fatal error in the evaluated code, the whole script exits."
Reproduce code:
---------------
$page = 'for(\$i=0;\$i<=2;\$i++){?>';
$page .= '<b>test code</b>';
$page .= '<? } ?>';
'
$cad = $page;
$cad = @eval($cad)==false ? echo $cad : ob_get_contents();
Expected result:
----------------
$cad should be $cad='<b>test code</b><b>test code</b><b>test
code</b>'
Actual result:
--------------
$cad is echod to the screen
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36758&edit=1