PHP, 21 20 / 15 / 13?21
This one is doing the job using variable indirection.
$$a=$b;echo $$b?1:0;$$a=$b;!!$$b;
Most other answers don't bother to put the result to the standard outputOr, soif you could reduce this furtherdon't need it to be bool
$$a=$b;!!$$$$a=$b;$$b;
Or, ifEDIT : I forgot to handle the case where you don't need ittry to be boolcompare two empty strings, so the code now is
$$a=$b;$$$$a=$b;!($a.$b)||$$b;
which is 21 chars.