When you cast false to a string for the purposes of echoing, you get the empty string "" (which isn't the same thing as null) - which would be why you don't see anything. true gets cast to a string that isn't empty - "1", as it happens.
If you cast false and true to integers first, (say, by using (int) or to_integer() or just 0+). Then when you echo the results they (are first cast to strings and then) come out as "0" and "1".
If you want to echo "true" or "false" depending on whether $debug is true or false, then the simplest solution is
echo $debug ? "true" : "false";