undeclared variable in php why through error? <p>As described in php manual </p> <blockquote> <p>It is not necessary to initialize variables in PHP however it is a very good practice. Uninitialized variables have a default value of their type depending on the context in which they are used - booleans default to FALSE, integers and floats default to zero, strings (e.g. used in echo) are set as an empty string and arrays become to an empty array</p> </blockquote> <p>if so then why its through error (notice) when try to access uninitialized variable? like</p> <pre><code>echo $x; </code></pre> <p>its return even in script following message </p> <blockquote> <p>Notice: Undefined variable: x...</p> </blockquote> <p>But When I declare <code>$x</code> as <code>NULL</code> then its not through any notice or error and working nicely</p> <pre><code>$x = NULL; echo $x; </code></pre> <p><strong>Now My Question</strong> is Why its through notice if not declare like <code>$x = NULL</code> or <code>$x = ''</code> although undeclared variable initialized as <code>NULL</code> which is clearly mentioned in Manual??</p> <p>I have a script and many uninitialized variable there and experiencing this issue.</p>