3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir = new DirectoryIterator(getcwd()); $list = array(); foreach($dir as $item) { if($item->isDir()) $list[] = $item->getPathname(); } shuffle($list); var_dump($list); $result = array_slice($list, 0, 4);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/SWP8Y
function name:  (null)
number of ops:  31
compiled vars:  !0 = $dir, !1 = $list, !2 = $item, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DirectoryIterator'
          1        INIT_FCALL                                               'getcwd'
          2        DO_ICALL                                         $5      
          3        SEND_VAR_NO_REF_EX                                       $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
    3     6        ASSIGN                                                   !1, <array>
    4     7      > FE_RESET_R                                       $9      !0, ->17
          8    > > FE_FETCH_R                                               $9, !2, ->17
    6     9    >   INIT_METHOD_CALL                                         !2, 'isDir'
         10        DO_FCALL                                      0  $10     
         11      > JMPZ                                                     $10, ->16
    7    12    >   INIT_METHOD_CALL                                         !2, 'getPathname'
         13        DO_FCALL                                      0  $12     
         14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  $12
    4    16    > > JMP                                                      ->8
         17    >   FE_FREE                                                  $9
    9    18        INIT_FCALL                                               'shuffle'
         19        SEND_REF                                                 !1
         20        DO_ICALL                                                 
   10    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   11    24        INIT_FCALL                                               'array_slice'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 0
         27        SEND_VAL                                                 4
         28        DO_ICALL                                         $15     
         29        ASSIGN                                                   !3, $15
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.42 ms | 1401 KiB | 21 Q