daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Mar 19th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.   $head = function($a) {
  4.     return array_shift($a);
  5.   };
  6.  
  7.   $tail = function($a) {
  8.     $first = array_shift($a);
  9.     return $a;
  10.   };
  11.  
  12.  
  13.   $loop = function($a) use (&$loop, $head, $tail){
  14.     if (!empty($head($a))){
  15.       print($head($a));
  16.       $loop($tail($a));
  17.     }
  18.   };
  19.  
  20.   $loop([1,2,3,4,5]);
RAW Paste Data
Top