3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} function f0($foo) {} function f1(Foo $foo) {} function f2(Foo $foo = null) {} $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f0(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10); $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f1(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10); $times = array(); for ($j = 0; $j < 10; $j++) { $start = microtime(true); for ($i = 0; $i < 1000000; $i++) { f2(new Foo()); } $times[] = microtime(true) - $start; } var_dump(array_sum($times) / 10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 36
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 69
Branch analysis from position: 92
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 83, Position 2 = 75
Branch analysis from position: 83
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 69
Branch analysis from position: 92
Branch analysis from position: 69
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 83, Position 2 = 75
Branch analysis from position: 83
Branch analysis from position: 75
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 42
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 36
Branch analysis from position: 59
Branch analysis from position: 36
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 42
Branch analysis from position: 50
Branch analysis from position: 42
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
Branch analysis from position: 3
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 9
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/SpBmi
function name:  (null)
number of ops:  100
compiled vars:  !0 = $times, !1 = $j, !2 = $start, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->24
   10     3    >   INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   11     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->15
   12     9    >   INIT_FCALL                                               'f0'
         10        NEW                                              $9      'Foo'
         11        DO_FCALL                                      0          
         12        SEND_VAR                                                 $9
         13        DO_FCALL                                      0          
   11    14        PRE_INC                                                  !3
         15    >   IS_SMALLER                                               !3, 1000000
         16      > JMPNZ                                                    ~13, ->9
   14    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $15     
         20        SUB                                              ~16     $15, !2
         21        ASSIGN_DIM                                               !0
         22        OP_DATA                                                  ~16
    9    23        PRE_INC                                                  !1
         24    >   IS_SMALLER                                               !1, 10
         25      > JMPNZ                                                    ~18, ->3
   16    26    >   INIT_FCALL                                               'var_dump'
         27        INIT_FCALL                                               'array_sum'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $19     
         30        DIV                                              ~20     $19, 10
         31        SEND_VAL                                                 ~20
         32        DO_ICALL                                                 
   18    33        ASSIGN                                                   !0, <array>
   19    34        ASSIGN                                                   !1, 0
         35      > JMP                                                      ->57
   20    36    >   INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $24     
         39        ASSIGN                                                   !2, $24
   21    40        ASSIGN                                                   !3, 0
         41      > JMP                                                      ->48
   22    42    >   INIT_FCALL                                               'f1'
         43        NEW                                              $27     'Foo'
         44        DO_FCALL                                      0          
         45        SEND_VAR                                                 $27
         46        DO_FCALL                                      0          
   21    47        PRE_INC                                                  !3
         48    >   IS_SMALLER                                               !3, 1000000
         49      > JMPNZ                                                    ~31, ->42
   24    50    >   INIT_FCALL                                               'microtime'
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $33     
         53        SUB                                              ~34     $33, !2
         54        ASSIGN_DIM                                               !0
         55        OP_DATA                                                  ~34
   19    56        PRE_INC                                                  !1
         57    >   IS_SMALLER                                               !1, 10
         58      > JMPNZ                                                    ~36, ->36
   26    59    >   INIT_FCALL                                               'var_dump'
         60        INIT_FCALL                                               'array_sum'
         61        SEND_VAR                                                 !0
         62        DO_ICALL                                         $37     
         63        DIV                                              ~38     $37, 10
         64        SEND_VAL                                                 ~38
         65        DO_ICALL                                                 
   28    66        ASSIGN                                                   !0, <array>
   29    67        ASSIGN                                                   !1, 0
         68      > JMP                                                      ->90
   30    69    >   INIT_FCALL                                               'microtime'
         70        SEND_VAL                                                 <true>
         71        DO_ICALL                                         $42     
         72        ASSIGN                                                   !2, $42
   31    73        ASSIGN                                                   !3, 0
         74      > JMP                                                      ->81
   32    75    >   INIT_FCALL                                               'f2'
         76        NEW                                              $45     'Foo'
         77        DO_FCALL                                      0          
         78        SEND_VAR                                                 $45
         79        DO_FCALL                                      0          
   31    80        PRE_INC                                                  !3
         81    >   IS_SMALLER                                               !3, 1000000
         82      > JMPNZ                                                    ~49, ->75
   34    83    >   INIT_FCALL                                               'microtime'
         84        SEND_VAL                                                 <true>
         85        DO_ICALL                                         $51     
         86        SUB                                              ~52     $51, !2
         87        ASSIGN_DIM                                               !0
         88        OP_DATA                                                  ~52
   29    89        PRE_INC                                                  !1
         90    >   IS_SMALLER                                               !1, 10
         91      > JMPNZ                                                    ~54, ->69
   36    92    >   INIT_FCALL                                               'var_dump'
         93        INIT_FCALL                                               'array_sum'
         94        SEND_VAR                                                 !0
         95        DO_ICALL                                         $55     
         96        DIV                                              ~56     $55, 10
         97        SEND_VAL                                                 ~56
         98        DO_ICALL                                                 
         99      > RETURN                                                   1

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

End of function f0

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

End of function f1

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

End of function f2

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.83 ms | 956 KiB | 23 Q