unidox Posted April 11, 2008 Share Posted April 11, 2008 What is the @ in php used for? Like @mysql_connect Link to comment https://forums.phpfreaks.com/topic/100724--/ Share on other sites More sharing options...
effigy Posted April 11, 2008 Share Posted April 11, 2008 @. I don't recommend it. Link to comment https://forums.phpfreaks.com/topic/100724--/#findComment-515150 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 Link to comment https://forums.phpfreaks.com/topic/100724--/#findComment-515152 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(); ?> Link to comment https://forums.phpfreaks.com/topic/100724--/#findComment-515176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.