php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22114 @echo not working
Submitted: 2003-02-07 14:57 UTC Modified: 2003-02-07 15:28 UTC
From: helly@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-02-07 (dev) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: helly@php.net
New email:
PHP Version: OS:

 

 [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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-07 15:04 UTC] derick@php.net
echo is not a function, but a language construct. Not a bug -> bogus.
 [2003-02-07 15:08 UTC] helly@php.net
I know of corse but shouldn't it be allowed for echo, too?
 [2003-02-07 15:28 UTC] helly@php.net
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); }

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 04:01:33 2025 UTC