Probably $addToWatchPage
is a string containing false
, otherwise your resultant first log message would be:
Sat Jan 26, 2013 @ 6:02 addToWatch=[] success=[1]
This would result in $addToWatchPage == true
being evaluated as true
, since 'false' == true
is a truthy expression (actually, any non-empty string other than '0'
is true when casted to boolean).
Make sure $addToWatchPage
is a boolean value instead of a string.
$addToWatchPage = false; // correct
$addToWatchPage = 'false'; // wrong