title: Looking for the equivalent of this JS function in PHP
body: <p>How can I get the same result with this JavaScript function with PHP 5.4 ?</p>
  
  <pre><code>  var item = ["footer", "__cpsExtensionHeader", "__cpsUrl", "__cpsPermalinkContainer", "setProperty", "translateY(-", "px)", "important", "style", "data---cpt", "fixed", "position", "auto", "transform", "translateY(", "transition"];
    (function(params, count) {
      var fn = function(selected_image) {
        for (; --selected_image;) {
          params["push"](params["shift"]());
        }
      };
      fn(++count);
    })(item, 224);
    var $ = function(i, fn) {
  
      i = i - 0;
      var id = item[i];
      return id;
    };
  </code></pre>
  
  <p>I've tried this:</p>
  
  <pre><code>$arrays = ["footer", "__cpsExtensionHeader", "__cpsUrl", "__cpsPermalinkContainer", "setProperty", "translateY(-", "px)", "important", "style", "data---cpt", "fixed", "position", "auto", "transform", "translateY(", "transition"];
  
  call_user_func_array(
      function ($params, $count) {
          $fn = function($selected_image) {
              for (; --$selected_image;) {
                  $var = array_push(array_shift($params), $selected_image);
              }
          };
          $fn(++$count);
      },
      array(&amp;$arrays, 240)
  );
  </code></pre>
  
  <p>But I stopped and I can't pass the parameter correctly to the self-called function</p>
  
  <p><code>array_shift()</code> expects parameter 1 to be an Array, null given in</p>