|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-07 14:57 UTC] helly@php.net
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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
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); }