Announcement

Collapse
No announcement yet.

Got a Q

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Got a Q

    Ok so whats with the @ sign?

    Like when you do @set_cookie('yay','yay', time()+10000);

    ?

    Whats that extra @ sign do. I notice that its used for headers and DB connections to.

    Thanks for any help!

  • #2
    If there is an error, it will not echo it out on the screen.

    Comment


    • #3
      AHA!!!!!!! That makes sense now, thanks a bunch!

      Comment


      • #4
        Just bear in mind that if the error is critical (which means the script has to stop execution), suppressing the error will only prevent the output - the script will still exit.
        Chen Avinadav
        Better to remain silent and be thought a fool than to speak out and remove all doubt.

        גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

        Comment


        • #5
          Yeah, actually I don't see a lot of use for it, I mean isn't it better to at least know the error is there and just fix it right of the bat?

          Heh fixing login problems is hard enough without having to first find out that there IS a cookie error at all!

          Comment


          • #6
            It is cool, because you can now catch errors and show them as you want, without getting 500 error msgs for a loop that goes wrong. Stuff like that. It also helps not showing numbers on the screen that are only to be used in functions, saves getting useless stuff posted. (erhm, i don't know how to properly explain that)

            Comment


            • #7
              Originally posted by xiphoid
              It is cool, because you can now catch errors and show them as you want, without getting 500 error msgs for a loop that goes wrong. Stuff like that. It also helps not showing numbers on the screen that are only to be used in functions, saves getting useless stuff posted. (erhm, i don't know how to properly explain that)
              No, for that you would use something like set_error_handler() and not the @ operator.
              Chen Avinadav
              Better to remain silent and be thought a fool than to speak out and remove all doubt.

              גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

              Comment


              • #8
                I understand, but .. you can supress it there and catch it in the function, like you mentioned. I know it won't be like @(); :P

                Comment


                • #9
                  Originally posted by xiphoid
                  I understand, but .. you can supress it there and catch it in the function, like you mentioned. I know it won't be like @(); :P

                  There is no need to suppress the error using the @ operator because if you have a custom error handler, PHP itself will not output the error information (your error handler is responsible for doing that).
                  Chen Avinadav
                  Better to remain silent and be thought a fool than to speak out and remove all doubt.

                  גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                  Comment


                  • #10
                    Thank you for explaining !

                    Comment

                    Loading...
                    Working...
                    X