title: javascript typeof doesn't work with PHP variables?
body: <p>Just wondering, does "typeof" javascript verification (you know, what you do to check for undefined variables in javascript) not work the same way with PHP vars?</p>
  
  <p>I do</p>
  
  <pre><code>alert(typeof &lt;? echo $_SESSION['thing'] ?&gt;);
  </code></pre>
  
  <p>and this doesn't even execute (I'd figure it would at least pop up as blank)</p>
  
  <p>But if I do</p>
  
  <pre><code>alert(&lt;? echo $_SESSION['thing'] ?&gt;);
  </code></pre>
  
  <p>the alert says "undefined"</p>
  
  <p>So I'm wondering if the correct way to check for undefined PHP vars using javascript is just to echo them? If it's not please correct me, but if it is I thought it'd be good to share.</p>
  
  <p>Thanks</p>