3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0, 1000); $time = microtime(true); array_map(function($el) { return $el; }, $a); var_dump(microtime(true) - $time); $time = microtime(true); foreach ($a as $el) { } var_dump(microtime(true) - $time);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/a3Ngq
function name:  (null)
number of ops:  37
compiled vars:  !0 = $a, !1 = $time, !2 = $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                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    7     9        INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fa3Ngq%3A7%240'
         11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
    8    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $9      
         18        SUB                                              ~10     $9, !1
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
   10    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !1, $12
   12    25      > FE_RESET_R                                       $14     !0, ->28
         26    > > FE_FETCH_R                                               $14, !2, ->28
         27    > > JMP                                                      ->26
         28    >   FE_FREE                                                  $14
   15    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $15     
         33        SUB                                              ~16     $15, !1
         34        SEND_VAL                                                 ~16
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.43 ms | 1405 KiB | 21 Q