PHP - Fatal error: Cannot access property started with '\0'
<p>This has got to be one of the strangest errors I have error come across jsut because the exact same code on two other systems work fine.</p>

<p>Let me explain my set up and how and where it works. First of all I am using zend framework and the error is thrown in the Zend/View/Abstract class on line 300.</p>

<p>Windows system running PHP 5.3.3 - Works Fine Here.
Linux Centos 5.5 system running PHP 5.3.3 - Works Fine here.
Linux Centos 5.5 system running PHP 5.3.6 - This system gives me the fatal error.</p>

<p>PHP -  Fatal error: Cannot access property started with '\0'</p>

<p>Looking at the setup I first thought that this had to be a bug in PHP but I am not so sure. I first had PHP 5.3.5 installed and upgraded to 5.3.6 but that didnt help.</p>

<p>The code throwing the error should work also so I am completely confused as to why I am getting the error on this system and not the other two.</p>

<p>Code that is throwing the error is :</p>

<pre><code>$this-&gt;$key = $val;
</code></pre>

<p>Located in the following method:</p>

<pre><code>public function __set($key, $val)
{
        if ('_' != substr($key, 0, 1)) {
            $this-&gt;$key = $val;
            return;
        }

        require_once 'Zend/View/Exception.php';
        $e = new Zend_View_Exception('Setting private or protected class members is not allowed');
        $e-&gt;setView($this);
        throw $e;
}
</code></pre>

<p>Any help would be greatly appreciated.</p>

<p>I did some further debugging and it isn't one of my variables causing the error. I found that when the $key variable was set to Zend_View_useViewStream the fatal error is thrown, so I vardumped it before and after it was string trimmed. </p>

<pre><code>KEY string(25) "Zend_View_useViewStream" 
TRIMMED string(24) "Zend_View_useViewStream" 
</code></pre>

<p>As you can see the string lenght is 1 character longer when the variable is not trimmed but they seem identical to me?? I guess the nul-byte [ "\0" (ASCII 0 (0x00)), the NUL-byte. ] is being stripped with trim but why is it being added on this system and not the others?</p>
