lopes_andre Posted June 13, 2010 Share Posted June 13, 2010 Hi, Sorry for this question, but I don't know what this simple line of code do. $salt = $this->store_salt ? $this->salt() : FALSE; Dont pay attention to the variables, just explain me how works the XX ? XXX : FALSE; Can some one help me? Best Regards, Link to comment https://forums.phpfreaks.com/topic/204642-help-what-this-line-of-code-does/ Share on other sites More sharing options...
cmgmyr Posted June 13, 2010 Share Posted June 13, 2010 It's just another way to handle an IF ELSE statement if($this->store_salt){ $salt = $this->store_salt; }else{ $salt = FALSE; } Link to comment https://forums.phpfreaks.com/topic/204642-help-what-this-line-of-code-does/#findComment-1071432 Share on other sites More sharing options...
phant0m Posted June 13, 2010 Share Posted June 13, 2010 http://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary Link to comment https://forums.phpfreaks.com/topic/204642-help-what-this-line-of-code-does/#findComment-1071433 Share on other sites More sharing options...
kenrbnsn Posted June 13, 2010 Share Posted June 13, 2010 The "?:" is a Ternary Operator: From the manual (scroll down a little) The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE. Ken Link to comment https://forums.phpfreaks.com/topic/204642-help-what-this-line-of-code-does/#findComment-1071434 Share on other sites More sharing options...
lopes_andre Posted June 13, 2010 Author Share Posted June 13, 2010 Thanks for the reply's. Solved. Link to comment https://forums.phpfreaks.com/topic/204642-help-what-this-line-of-code-does/#findComment-1071482 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.