unidox Posted April 11, 2008 Share Posted April 11, 2008 What is the @ in php used for? Like @mysql_connect Quote Link to comment Share on other sites More sharing options...
effigy Posted April 11, 2008 Share Posted April 11, 2008 @. I don't recommend it. Quote Link to comment Share on other sites More sharing options...
unidox Posted April 11, 2008 Author Share Posted April 11, 2008 Ok, I was also wondering what does -> do? I have seen in some scripts people have ->. Like $db->query Quote Link to comment Share on other sites More sharing options...
discomatt Posted April 11, 2008 Share Posted April 11, 2008 @ suppresses errors. Can come in handy, but only recommend using in a production environment, after all testing is done, with a strong ability to debug, and a lot of error checking in your code. AKA - avoid using it unless you know what you're doing. -> is referencing a method or variable within an object or class. Example <?php class test { public function someMethod() { echo 'Hello world!'; } } $obj = new test; $obj->someMethod(); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.