3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0, 1000); $time = microtime(true); array_map(function($el) { return $el * $el; }, $a); var_dump(microtime(true) - $time); $time = microtime(true); $b = []; foreach ($a as $el) { $b[] = $el * $el; } var_dump(microtime(true) - $time);
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/so147
function name:  (null)
number of ops:  41
compiled vars:  !0 = $a, !1 = $time, !2 = $b, !3 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 1000
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    5     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
    7     9        INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fso147%3A7%240'
         11        SEND_VAL                                                 ~8
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
    9    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $10     
         18        SUB                                              ~11     $10, !1
         19        SEND_VAL                                                 ~11
         20        DO_ICALL                                                 
   11    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $13     
         24        ASSIGN                                                   !1, $13
   13    25        ASSIGN                                                   !2, <array>
   15    26      > FE_RESET_R                                       $16     !0, ->32
         27    > > FE_FETCH_R                                               $16, !3, ->32
   16    28    >   MUL                                              ~18     !3, !3
         29        ASSIGN_DIM                                               !2
         30        OP_DATA                                                  ~18
   15    31      > JMP                                                      ->27
         32    >   FE_FREE                                                  $16
   19    33        INIT_FCALL                                               'var_dump'
         34        INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $19     
         37        SUB                                              ~20     $19, !1
         38        SEND_VAL                                                 ~20
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2Fso147%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.88 ms | 1400 KiB | 21 Q