3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = range(0, 100000); $keys = array_map(function ($x) { return chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . $x; }, $x); $vars = array_combine($keys, $x); function _ext() { extract(func_get_args(0)); } function _for() { foreach (func_get_args(0) as $__k => $__v) { $$__k = $__v; } unset($__k, $__v); } $t = -microtime(TRUE); _ext($vars); echo sprintf("%.4f", $t + microtime(TRUE)); $t = -microtime(TRUE); _for($vars); echo sprintf("%.4f", $t + microtime(TRUE));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0e81
function name:  (null)
number of ops:  51
compiled vars:  !0 = $x, !1 = $keys, !2 = $vars, !3 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    3     5        INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
    5     7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
    3     9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    6    11        INIT_FCALL                                               'array_combine'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
   19    16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $11     
         19        MUL                                              ~12     $11, -1
         20        ASSIGN                                                   !3, ~12
   20    21        INIT_FCALL                                               '_ext'
         22        SEND_VAR                                                 !2
         23        DO_FCALL                                      0          
   21    24        INIT_FCALL                                               'sprintf'
         25        SEND_VAL                                                 '%25.4f'
         26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $15     
         29        ADD                                              ~16     !3, $15
         30        SEND_VAL                                                 ~16
         31        DO_ICALL                                         $17     
         32        ECHO                                                     $17
   23    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $18     
         36        MUL                                              ~19     $18, -1
         37        ASSIGN                                                   !3, ~19
   24    38        INIT_FCALL                                               '_for'
         39        SEND_VAR                                                 !2
         40        DO_FCALL                                      0          
   25    41        INIT_FCALL                                               'sprintf'
         42        SEND_VAL                                                 '%25.4f'
         43        INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $22     
         46        ADD                                              ~23     !3, $22
         47        SEND_VAL                                                 ~23
         48        DO_ICALL                                         $24     
         49        ECHO                                                     $24
         50      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0e81
function name:  {closure}
number of ops:  30
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'chr'
          2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 26
          5        DO_ICALL                                         $1      
          6        ADD                                              ~2      46, $1
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                         $3      
          9        INIT_FCALL                                               'chr'
         10        INIT_FCALL                                               'rand'
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 26
         13        DO_ICALL                                         $4      
         14        ADD                                              ~5      46, $4
         15        SEND_VAL                                                 ~5
         16        DO_ICALL                                         $6      
         17        CONCAT                                           ~7      $3, $6
         18        INIT_FCALL                                               'chr'
         19        INIT_FCALL                                               'rand'
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 26
         22        DO_ICALL                                         $8      
         23        ADD                                              ~9      46, $8
         24        SEND_VAL                                                 ~9
         25        DO_ICALL                                         $10     
         26        CONCAT                                           ~11     ~7, $10
         27        CONCAT                                           ~12     ~11, !0
         28      > RETURN                                                   ~12
    5    29*     > RETURN                                                   null

End of Dynamic Function 0

Function _ext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e0e81
function name:  _ext
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'extract'
          1        INIT_FCALL                                               'func_get_args'
          2        SEND_VAL                                                 0
          3        DO_ICALL                                         $0      
          4        SEND_VAL                                                 $0
          5        DO_ICALL                                                 
   10     6      > RETURN                                                   null

End of function _ext

Function _for:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/e0e81
function name:  _for
number of ops:  13
compiled vars:  !0 = $__v, !1 = $__k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'func_get_args'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                         $2      
          3      > FE_RESET_R                                       $3      $2, ->9
          4    > > FE_FETCH_R                                       ~4      $3, !0, ->9
          5    >   ASSIGN                                                   !1, ~4
   14     6        FETCH_W                      local               $6      !1
          7        ASSIGN                                                   $6, !0
   13     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $3
   16    10        UNSET_CV                                                 !1
         11        UNSET_CV                                                 !0
   17    12      > RETURN                                                   null

End of function _for

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1480 KiB | 24 Q