what does @ do in PHP ?

Posted on 2009-02-20
Last Modified: 2012-05-06
e.g. in the snippet below.
What is the purpose of the @() around the function call?

It works equally well without the @-brackets enclosing it.

My PHP book has no entry for it, and the search box on doesn't recognise @...

    if ($size=@(getimagesize('main_YSNS.swf'))) 


        echo 'Width: ', $size[0], ' Height: ', $size[1];

    }  // End if


Open in new window

Question by:zorba111
    LVL 28

    Accepted Solution

    Will hide error, if something is wrong with the function without the @ and assuming the php ini file allow it you will see an error message displayed

    Author Comment

    that's gotta be a record (timewise)!

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    php simulator 5 55
    Updating PHP in Windows Server 2012 r2 22 43
    PHP foreach DB query 4 20
    phpMyAdmin simple sql statement 3 0
    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now