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: None
 [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

Pull Requests

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.
 [2022-01-29 12:40 UTC] dsnou849 at gmail dot com
Thanks for the post, I'll try to sort this out later when I've handed in all my essays and dissertations because my study is starting to piss me off. I will most likely seek help from uk coursework help https://www.essaygeeks.co.uk/coursework/ who will help me with my written work, I want to quickly deal with this problem
 [2022-02-09 13:16 UTC] linajulie09 at gmail dot com
Amazing code info. You can find and book cheap flights tickets and best holiday packages here: https://dreamworldtravel.co.uk
 [2023-03-22 06:37 UTC] asleypatricia5 at gmail dot com
Delightful and the most effective topic is for discussing but there are also very beneficial and well differ experts available like the most effective Assignment Master UK, assignmentmaster.org.uk which is so famous for giving all assignment help services at one click.
 [2023-11-27 07:46 UTC] ew685283 at gmail dot com
Great post! I really enjoyed reading your insights and the way you presented your ideas was clear and engaging. Thank you for sharing your knowledge and perspective with us.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC