3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(0,100000); $t = microtime(1); array_map(function($v) { $v++; }, $a); $t = microtime(1) - $t; echo "map func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_map($func, $a); $t = microtime(1) - $t; echo "map var func: $t\n"; $a = range(0,100000); $t = microtime(1); array_walk($a, function($v) { $v++; }); $t = microtime(1) - $t; echo "walk func: $t\n"; $a = range(0,100000); $t = microtime(1); $func = function($v) { $v++; }; array_walk($a, $func); $t = microtime(1) - $t; echo "walk var func: $t\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pS1AR
function name:  (null)
number of ops:  95
compiled vars:  !0 = $a, !1 = $t, !2 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    5     9        INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpS1AR%3A5%240'
         11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
    6    14        INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $9      
         17        SUB                                              ~10     $9, !1
         18        ASSIGN                                                   !1, ~10
    7    19        ROPE_INIT                                     3  ~13     'map+func%3A+'
         20        ROPE_ADD                                      1  ~13     ~13, !1
         21        ROPE_END                                      2  ~12     ~13, '%0A'
         22        ECHO                                                     ~12
    9    23        INIT_FCALL                                               'range'
         24        SEND_VAL                                                 0
         25        SEND_VAL                                                 100000
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !0, $15
   10    28        INIT_FCALL                                               'microtime'
         29        SEND_VAL                                                 1
         30        DO_ICALL                                         $17     
         31        ASSIGN                                                   !1, $17
   11    32        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpS1AR%3A11%241'
         33        ASSIGN                                                   !2, ~19
   12    34        INIT_FCALL                                               'array_map'
         35        SEND_VAR                                                 !2
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                                 
   13    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 1
         40        DO_ICALL                                         $22     
         41        SUB                                              ~23     $22, !1
         42        ASSIGN                                                   !1, ~23
   14    43        ROPE_INIT                                     3  ~26     'map+var+func%3A+'
         44        ROPE_ADD                                      1  ~26     ~26, !1
         45        ROPE_END                                      2  ~25     ~26, '%0A'
         46        ECHO                                                     ~25
   16    47        INIT_FCALL                                               'range'
         48        SEND_VAL                                                 0
         49        SEND_VAL                                                 100000
         50        DO_ICALL                                         $28     
         51        ASSIGN                                                   !0, $28
   17    52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 1
         54        DO_ICALL                                         $30     
         55        ASSIGN                                                   !1, $30
   18    56        INIT_FCALL                                               'array_walk'
         57        SEND_REF                                                 !0
         58        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpS1AR%3A18%242'
         59        SEND_VAL                                                 ~32
         60        DO_ICALL                                                 
   19    61        INIT_FCALL                                               'microtime'
         62        SEND_VAL                                                 1
         63        DO_ICALL                                         $34     
         64        SUB                                              ~35     $34, !1
         65        ASSIGN                                                   !1, ~35
   20    66        ROPE_INIT                                     3  ~38     'walk+func%3A+'
         67        ROPE_ADD                                      1  ~38     ~38, !1
         68        ROPE_END                                      2  ~37     ~38, '%0A'
         69        ECHO                                                     ~37
   22    70        INIT_FCALL                                               'range'
         71        SEND_VAL                                                 0
         72        SEND_VAL                                                 100000
         73        DO_ICALL                                         $40     
         74        ASSIGN                                                   !0, $40
   23    75        INIT_FCALL                                               'microtime'
         76        SEND_VAL                                                 1
         77        DO_ICALL                                         $42     
         78        ASSIGN                                                   !1, $42
   24    79        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FpS1AR%3A24%243'
         80        ASSIGN                                                   !2, ~44
   25    81        INIT_FCALL                                               'array_walk'
         82        SEND_REF                                                 !0
         83        SEND_VAR                                                 !2
         84        DO_ICALL                                                 
   26    85        INIT_FCALL                                               'microtime'
         86        SEND_VAL                                                 1
         87        DO_ICALL                                         $47     
         88        SUB                                              ~48     $47, !1
         89        ASSIGN                                                   !1, ~48
   27    90        ROPE_INIT                                     3  ~51     'walk+var+func%3A+'
         91        ROPE_ADD                                      1  ~51     ~51, !1
         92        ROPE_END                                      2  ~50     ~51, '%0A'
         93        ECHO                                                     ~50
         94      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FpS1AR%3A5%240

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

End of function %00%7Bclosure%7D%2Fin%2FpS1AR%3A11%241

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

End of function %00%7Bclosure%7D%2Fin%2FpS1AR%3A18%242

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

End of function %00%7Bclosure%7D%2Fin%2FpS1AR%3A24%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.57 ms | 1408 KiB | 21 Q