ID: 22114
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 5CVS-2003-02-07 (dev)
New Comment:
The following patch *is* not the beautiful way to solve it but is shows
its working. Anyway it works when using print instead of echo which is
handled as an expression.
Index: Zend/zend_language_parser.y
===================================================================
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.86
diff -u -r1.86 zend_language_parser.y
--- Zend/zend_language_parser.y 1 Feb 2003 01:49:14 -0000 1.86
+++ Zend/zend_language_parser.y 7 Feb 2003 21:25:05 -0000
@@ -202,6 +202,7 @@
| T_GLOBAL global_var_list ';'
| T_STATIC static_var_list ';'
| T_ECHO echo_expr_list ';'
+ | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } T_ECHO
echo_expr_list ';' { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
| T_INLINE_HTML { zend_do_echo(&$1
TSRMLS_CC); }
| expr ';' {
zend_do_free(&$1 TSRMLS_CC); }
| T_USE use_filename ';' {
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use
include_once() or require_once()"); zval_dtor(&$2.u.constant); }
Previous Comments:
------------------------------------------------------------------------
[2003-02-07 15:08:43] [EMAIL PROTECTED]
I know of corse but shouldn't it be allowed for echo, too?
------------------------------------------------------------------------
[2003-02-07 15:04:43] [EMAIL PROTECTED]
echo is not a function, but a language construct. Not a bug -> bogus.
------------------------------------------------------------------------
[2003-02-07 14:57:35] [EMAIL PROTECTED]
One cannot use '@' to hide warnings inside 'echo'.
Example:
[marcus@zaphod php-HEAD]$ php -r '@echo "<$x>";'
Command line code(1) : Parse error - parse error, unexpected T_ECHO
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22114&edit=1