Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php not returning value of false

I cannot get a false value to return here. A true value returns fine. What am I missing?

if ((count($this->_brokenRulesCollection)) == 0)  {
    return true;
} else {
    return false;
}
like image 367
Stepppo Avatar asked Dec 24 '09 03:12

Stepppo


1 Answers

In PHP, false when converted to a string is an empty string, and true converted to a string is "1".

Use var_dump instead of echo for debugging.

like image 164
Nicolás Avatar answered Nov 15 '22 12:11

Nicolás