title: PHP: Illegal string-offset
body: <p>My <a href="http://www.github.com/audith/Persephone" rel="nofollow">open-source project</a> was working just fine, until I started to work on it after 6 month of break. Updated to latest XAMPP, and start getting tons of weird errors, one of which is as:</p>
  
  <p>I have Input class, with a caller method as:</p>
  
  <pre><code>&lt;?php
  class Input
  {
      public function __call ( $name , $arguments )
      {
          if ( !in_array( $name, array( "post", "get", "cookie", "request", "server", "env" ) ) )
          {
              throw new Exception( "Input::" . $name . "() not declared!" );
          }
  
          $_name_of_superglobal = "_" . strtoupper( $name );
          $_max_iteration_level_for_cleanup = in_array( $name, array( "server", "env" ) ) ? 1 : 10;
  
          # $arguments[0] is the index of the value, to be fetched from within the array.
          if ( !empty( $arguments[0] ) and array_key_exists( $arguments[0], $this-&gt;$name ) )
          {
              return $this-&gt;$name[ $arguments[0] ];
          }
          elseif ( !empty( $arguments[0] ) and array_key_exists( $arguments[0], $GLOBALS[ $_name_of_superglobal ] ) )
          {
              return $this-&gt;$name[ $this-&gt;clean__makesafe_key( $arguments[0] ) ] = $this-&gt;clean__makesafe_value( $GLOBALS[ $_name_of_superglobal ][ $arguments[0] ], array(), true );
          }
          elseif ( !empty( $arguments[0] ) and !array_key_exists( $arguments[0], $GLOBALS[ $_name_of_superglobal ] ) )
          {
              return null;
          }
          else
          {
              if ( $this-&gt;_is_cleanup_done_for[ $name ] === true )
              {
                  return $this-&gt;$name;
              }
              $this-&gt;_is_cleanup_done_for[ $name ] = true;
              return $this-&gt;$name = $this-&gt;clean__makesafe_recursively( $GLOBALS[ $_name_of_superglobal ], $_max_iteration_level_for_cleanup );
          }
      }
  ?&gt;
  </code></pre>
  
  <p>This piece of code, works like this: you ask certain superglobal value from it, and it returns clean version of it, on-demand:</p>
  
  <pre><code>&lt;?php
  $input = new Input();
  $server_name = $input-&gt;server("SERVER_NAME");
  ?&gt;
  </code></pre>
  
  <p>Easy right? Well, after I updated PHP with XAMPP, it just doesn't work [edit: it works, with the Warning message] - error is:</p>
  
  <pre><code>PHP Warning:  Illegal string offset 'SERVER_NAME' in S:\...\kernel\input.php on line 159
  </code></pre>
  
  <p>line, which corresponds to line of code:</p>
  
  <pre><code>return $this-&gt;$name[ $this-&gt;clean__makesafe_key( $arguments[0] ) ] = $this-&gt;clean__makesafe_value( $GLOBALS[ $_name_of_superglobal ][ $arguments[0] ], array(), true );
  </code></pre>
  
  <p>which is stupid: <code>$_name_of_superglobal</code> = "_SERVER" there, and <code>$arguments[0]</code> = "SERVER_NAME" and overall assignment is string which gets cleaned.</p>
  
  <p>WHAT MIGHT BE THE PROBLEM THERE? I am totally lost here!</p>