3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $foo = 'bar'; } $bar = function() { $foo = 'bar'; }; $tries = 1E5; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { foo(); } echo (microtime(true) - $start); $start = microtime(true); for ($i = 0; $i < $tries; $i++) { $bar(); } echo (microtime(true) - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 25
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 25
Branch analysis from position: 30
Branch analysis from position: 25
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/159dP
function name:  (null)
number of ops:  36
compiled vars:  !0 = $bar, !1 = $tries, !2 = $start, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F159dP%3A7%240'
          1        ASSIGN                                                   !0, ~4
   11     2        ASSIGN                                                   !1, 100000
   13     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   14     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->12
   15     9    >   INIT_FCALL                                               'foo'
         10        DO_FCALL                                      0          
   14    11        PRE_INC                                                  !3
         12    >   IS_SMALLER                                               !3, !1
         13      > JMPNZ                                                    ~12, ->9
   17    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $13     
         17        SUB                                              ~14     $13, !2
         18        ECHO                                                     ~14
   19    19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        ASSIGN                                                   !2, $15
   20    23        ASSIGN                                                   !3, 0
         24      > JMP                                                      ->28
   21    25    >   INIT_DYNAMIC_CALL                                        !0
         26        DO_FCALL                                      0          
   20    27        PRE_INC                                                  !3
         28    >   IS_SMALLER                                               !3, !1
         29      > JMPNZ                                                    ~20, ->25
   23    30    >   INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $21     
         33        SUB                                              ~22     $21, !2
         34        ECHO                                                     ~22
         35      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/159dP
function name:  foo
number of ops:  2
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'bar'
    5     1      > RETURN                                                   null

End of function foo

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.81 ms | 1403 KiB | 16 Q