Darkness Soul Posted April 18, 2006 Share Posted April 18, 2006 Hi guys,I'm not sure about the knowledge level of this topic, so, here I am.. =) another newbie question!I was studing a little more about security, scripts, code standart.. and found this one.. so I've read:[b]"Avoid warnings of E_STRICT mode"[/b]The code just test this one with [b]error_reporting(0)[/b] and.. well.. o-o" i don't understood this.What is this E_STRICT and how useful is it?---edit:I dont want to create a topic to this question, so I will use this..I've seen it: if ( !@$color )!@? What its do??---=) Thank anyway..D.Soul Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 18, 2006 Share Posted April 18, 2006 E_STRICT is an error reporting level. But it doesnt return errors in your code but PHP will suggest changes to be made to your code which will ensure the best interoperability and forward compatibility of your code.The thing about !@ is a form of lasy programming, apart form the ! symbol. The ! symbol is a comparison operater which means [b]not[/b] in PHP terms. For example you want to check a variable is not set you'll do this:[code]if(!$var){ //set $var $var = "something";}[/code]Now when you run that code you are likely to get a php notice error which says var is not defined, meaning var is a non existent variable in your script. What (lazy) programmers tend to do is place an @ symbol in front of $var. The @ supresses the error message meaning no error is shown. But this is lazy! I tend to do the following:[code]if(!isset($var)){ //set $var $var = "something";}[/code]isset does what the function is called all it does is check whether a variable is actually set. The allows me not to be tempted to use the @ symbol.Hope that helps. Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted April 18, 2006 Author Share Posted April 18, 2006 That helps a lot..I use isset to do it, but never seen before that @.. that's why I'm surpriesed!! About the E_Stritc.. so, this may help me to make a better code.. if someone is ugly, the php will "warning me", rigth?Hmmm, it's look cool, need to learn how to use this =DThanks,D.Soul 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.