|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14640 Support "{@$foo}" and "{@$foo['bar']}" syntax
Submitted: 2001-12-21 08:21 UTC Modified: 2012-05-24 03:59 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: mfischer at guru dot josefine dot at Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.1.0 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
31 - 9 = ?
Subscribe to this entry?

 [2001-12-21 08:21 UTC] mfischer at guru dot josefine dot at
$ php -q
<? error_reporting(E_ALL);
echo "{@$array['key']}"; ?>
<br />
<b>Parse error</b>:  parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in <b>-</b> on line <b>2</b><br />
-(2) : Parse error - parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

$ php -q
<? error_reporting(E_ALL);
echo "{@$foo}\n";
<br />
<b>Warning</b>:  Undefined variable:  foo in <b>-</b> on line <b>2</b><br />
-(2) : Warning - Undefined variable:  foo

Would be nice to support the @ operator in those cases too.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-11 16:10 UTC] destes at ix dot netcom dot com
what sorts of errors aren't being suppressed now?  If the variable doesn't exist, nothing is output, and in a function context, FALSE is returned.  I don't see the need... perhaps you could explain it?
 [2010-12-29 11:59 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: Scripting Engine problem
 [2010-12-29 11:59 UTC]
Hell no, rather get rid of @ altogether.
 [2012-05-24 02:01 UTC] lijingyan922 at gmail dot com
Your blog is very informative and useful. You have written it very well. I have 
bookmarked your blog. Your blog written in very good, I like it very much, I will 
often come to.Thank you to let me see your blog, I love you blog style, very 
cool.Your blog too good, I will soon come back again, to keep at it.Your website 
is very beautiful, you do something great!!Your essay is good, I like it very 
much. Excellent Blog! I really admire your thinking and the way you have put these 
information in this post.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 04:03:33 2021 UTC