IF you're assing '0' to '$a' like this, $a == 0, of course it doesn't work, because you're not assigning a value, but checking for equality (not strict);
This code:
$a = 0;
if ($a == 1) throw new Exception("Message");
echo "Dose not execute for $a == 0";
works. I.E., the echo works ("Dose not execute for 0 == 0"), since $a != 1. and no exception is thrown.
You should use single quotes to have a message (wrong as it is) like "Dose not execute for $a == 0", since with double quotes the variable is subsitute in the string.
this code:
$a = 1;
if ($a == 1) throw new Exception("Message");
echo "Dose not execute for $a == 0";
throws an exception, which stops the running of the script and the echo doesn't get executed. So, it works.
A code like yours,
$a == 0;
if ($a == 1) throw new Exception("Message");
echo "Dose not execute for $a == 0";
Simply returns an Undefined variable error, since $a is not defined. Most likely, you don't have error enabled/displayed and cannot, as a consequence, see anything.