01-28-2009, 05:20 PM
|
#69 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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.
|
|
|
|