3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [1, 'xxx', 'yyy'], [2, 'xxx', 'yyy'], [3, 'xxx', 'yyy'], [4, 'xxx', 'yyy'], [5, 'xxx', 'yyy'], [6, 'xxx', 'yyy'], [7, 'xxx', 'yyy'], [8, 'xxx', 'yyy'], [9, 'xxx', 'yyy'], [10, 'xxx', 'yyy'], [11, 'xxx', 'yyy'], [12, 'xxx', 'yyy'], [13, 'xxx', 'yyy'], [14, 'xxx', 'yyy'], [15, 'xxx', 'yyy'], [16, 'xxx', 'yyy'], [17, 'xxx', 'yyy'], [18, 'xxx', 'yyy'], [19, 'xxx', 'yyy'] ]; $t = microtime(true); $result = array_map(function($v){ return $v[0]; }, $array); echo number_format(microtime(true) - $t, 10), PHP_EOL; $t = microtime(true); $result = array(); foreach($array as $v)$result[] = $v[0]; echo number_format(microtime(true) - $t, 10), PHP_EOL; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/3haGa
function name:  (null)
number of ops:  44
compiled vars:  !0 = $array, !1 = $t, !2 = $result, !3 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   24     1        INIT_FCALL                                                   'microtime'
          2        SEND_VAL                                                     <true>
          3        DO_ICALL                                             $5      
          4        ASSIGN                                                       !1, $5
   26     5        INIT_FCALL                                                   'array_map'
          6        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
          7        SEND_VAL                                                     ~7
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                             $8      
         10        ASSIGN                                                       !2, $8
   28    11        INIT_FCALL                                                   'number_format'
         12        INIT_FCALL                                                   'microtime'
         13        SEND_VAL                                                     <true>
         14        DO_ICALL                                             $10     
         15        SUB                                                  ~11     $10, !1
         16        SEND_VAL                                                     ~11
         17        SEND_VAL                                                     10
         18        DO_ICALL                                             $12     
         19        ECHO                                                         $12
         20        ECHO                                                         '%0A'
   30    21        INIT_FCALL                                                   'microtime'
         22        SEND_VAL                                                     <true>
         23        DO_ICALL                                             $13     
         24        ASSIGN                                                       !1, $13
   32    25        ASSIGN                                                       !2, <array>
   34    26      > FE_RESET_R                                           $16     !0, ->32
         27    > > FE_FETCH_R                                                   $16, !3, ->32
         28    >   FETCH_DIM_R                                          ~18     !3, 0
         29        ASSIGN_DIM                                                   !2
         30        OP_DATA                                                      ~18
         31      > JMP                                                          ->27
         32    >   FE_FREE                                                      $16
   36    33        INIT_FCALL                                                   'number_format'
         34        INIT_FCALL                                                   'microtime'
         35        SEND_VAL                                                     <true>
         36        DO_ICALL                                             $19     
         37        SUB                                                  ~20     $19, !1
         38        SEND_VAL                                                     ~20
         39        SEND_VAL                                                     10
         40        DO_ICALL                                             $21     
         41        ECHO                                                         $21
         42        ECHO                                                         '%0A'
   37    43      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3haGa
function name:  {closure:/in/3haGa:26}
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 0
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.3 ms | 2193 KiB | 16 Q