title: Why the variable is not visible?
body: <p>I have this kind of XML file with PHP processing instructions:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?php
    $a = 8;
  ?&gt;
  &lt;?php function add_some() { ?&gt;
    &lt;element attr="&lt;?php echo $a ?&gt;"/&gt;
  &lt;?php } ?&gt;
  
  &lt;elements&gt;
    &lt;?php
      add_some();
      add_some();
    ?&gt;
  &lt;/elements&gt;
  </code></pre>
  
  <p>When I process it with <code>php test.xml</code>, I get:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;elements&gt;
      &lt;element attr="PHP Notice:  Undefined variable: a in test.xml on line 5
  "/&gt;
    &lt;element attr="PHP Notice:  Undefined variable: a in test.xml on line 5
  "/&gt;
  &lt;/elements&gt;
  </code></pre>
  
  <p>Tell me how to fix it, please?</p>