title: assign an array to a variable changed the type?
body: <p>I get this error when I assign my array to a variable:</p>
  
  <blockquote>
    <p>'krsort()` expects parameter 1 to be array, string given</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>    if ( !in_array( $controller, $bypass_controller ) ) {
          $sesscontroller = $this-&gt;CI-&gt;privileges-&gt;getcontrolleruri();
          if ( $sesscontroller &amp;&amp; empty( $sesscontroller ) ) {
              $sesscontroller      = $this-&gt;CI-&gt;session-&gt;userdata( SESS_PREFIK . 'controllers' );
              $arrcnt              = array(
                  'menu_name'  =&gt; 'Add',
                  'controller' =&gt; ''
              );
              $sesscontroller[]    = $arrcnt;
  
          } else {
              if ( !is_null( $sesscontroller ) ) {
                  krsort( $sesscontroller );
                  $this-&gt;CI-&gt;session-&gt;set_userdata( array(
                      SESS_PREFIK . 'controllers' =&gt; $sesscontroller
                  ) );
              }
          }
  </code></pre>
  
  <p>Why do I get this error?</p>