Thread: The SQL Class
View Single Post
Old 01-28-2009, 05:20 PM   #69 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

It just means that the line like:
PHP Code:
$query_result = (is_null($sql) && isset($this->query_result)) ? $this->query_result $this->exeQuery($sql)->getQueryResult(); 
might as well be:
PHP Code:
if (is_null($sql) && isset($this->query_result))
{
    
$query_result $this->query_result;
}
else
{
    
$query_result $this->exeQuery($sql)->getQueryResult();

It's just much easier to scan the code quickly and see what's happening in the if/else than it is in one long ternary line. If you still want to use the ternary operator, at least split it onto multiple lines.
Salathe is offline  
Reply With Quote