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'] ]; $t = microtime(true); $result = array_map(function($v){ return $v[0]; }, $array); echo microtime(true) - $t, PHP_EOL; $t = microtime(true); $result = array(); foreach($array as $v)$result[] = $v[0]; echo microtime(true) - $t, PHP_EOL; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/JViKY
function name:  (null)
number of ops:  36
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                                  '%00%7Bclosure%7D%2Fin%2FJViKY%3A26%240'
          7        SEND_VAL                                                 ~7
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   28    11        INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $10     
         14        SUB                                              ~11     $10, !1
         15        ECHO                                                     ~11
         16        ECHO                                                     '%0A'
   30    17        INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !1, $12
   32    21        ASSIGN                                                   !2, <array>
   34    22      > FE_RESET_R                                       $15     !0, ->28
         23    > > FE_FETCH_R                                               $15, !3, ->28
         24    >   FETCH_DIM_R                                      ~17     !3, 0
         25        ASSIGN_DIM                                               !2
         26        OP_DATA                                                  ~17
         27      > JMP                                                      ->23
         28    >   FE_FREE                                                  $15
   36    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $18     
         32        SUB                                              ~19     $18, !1
         33        ECHO                                                     ~19
         34        ECHO                                                     '%0A'
   38    35      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJViKY%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JViKY
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FJViKY%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.27 ms | 1405 KiB | 17 Q