php.net |  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
Votes:1
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:
Have you experienced this issue?
Rate the importance of this bug to you:

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: Scripting Engine problem
 [2010-12-29 11:59 UTC] jani@php.net
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-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 18:02:13 2014 UTC