3v4l.org

run code in 300+ 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'], [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, 3), PHP_EOL; $t = microtime(true); $result = array(); foreach($array as $v)$result[] = $v[0]; echo number_format(microtime(true) - $t, 3), 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/XgtZu
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>
   43     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   45     5        INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXgtZu%3A45%240'
          7        SEND_VAL                                                 ~7
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   47    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                                                 3
         18        DO_ICALL                                         $12     
         19        ECHO                                                     $12
         20        ECHO                                                     '%0A'
   49    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $13     
         24        ASSIGN                                                   !1, $13
   51    25        ASSIGN                                                   !2, <array>
   53    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
   55    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                                                 3
         40        DO_ICALL                                         $21     
         41        ECHO                                                     $21
         42        ECHO                                                     '%0A'
   56    43      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXgtZu%3A45%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XgtZu
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXgtZu%3A45%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.27 ms | 1400 KiB | 19 Q