[PHP-DOC] #36758 [Bgs]: eval not behaving like in documantation

2006-03-16 Thread colder
 ID:  36758
 Updated by:  [EMAIL PROTECTED]
 Reported By: khan dot shadow at gmail dot com
 Status:  Bogus
 Bug Type:Documentation problem
 PHP Version: Irrelevant
 New Comment:

There are a lot of non-sense in your post:

1) variables don't have to be escaped inside single quotes, the
evaluated code will result to a parse error.

2) you can't use echo in a return context, because echo is a language
construct that doesn't behave like a function.

3) your eval() will always be evaluated as false : As of PHP 4, eval()
returns NULL unless return is called in the evaluated code.






Previous Comments:


[2006-03-16 12:12:39] [EMAIL PROTECTED]

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.



[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 .= 'btest code/b';
$page .= '? } ?';
'
$cad = $page;
$cad = @eval($cad)==false ? echo $cad : ob_get_contents();



Expected result:

$cad should be $cad='btest code/bbtest code/bbtest code/b'

Actual result:
--
$cad is echod to the screen





-- 
Edit this bug report at http://bugs.php.net/?id=36758edit=1


[PHP-DOC] #36758 [Bgs]: eval not behaving like in documantation

2006-03-16 Thread khan dot shadow at gmail dot com
 ID:  36758
 User updated by: khan dot shadow at gmail dot com
 Reported By: khan dot shadow at gmail dot com
 Status:  Bogus
 Bug Type:Documentation problem
 PHP Version: Irrelevant
 New Comment:

never mind...problem solved :)


Previous Comments:


[2006-03-16 16:10:49] [EMAIL PROTECTED]

There are a lot of non-sense in your post:

1) variables don't have to be escaped inside single quotes, the
evaluated code will result to a parse error.

2) you can't use echo in a return context, because echo is a language
construct that doesn't behave like a function.

3) your eval() will always be evaluated as false : As of PHP 4, eval()
returns NULL unless return is called in the evaluated code.







[2006-03-16 12:12:39] [EMAIL PROTECTED]

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.



[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 .= 'btest code/b';
$page .= '? } ?';
'
$cad = $page;
$cad = @eval($cad)==false ? echo $cad : ob_get_contents();



Expected result:

$cad should be $cad='btest code/bbtest code/bbtest code/b'

Actual result:
--
$cad is echod to the screen





-- 
Edit this bug report at http://bugs.php.net/?id=36758edit=1