3v4l.org

run code in 300+ PHP versions simultaneously
<?php function html($value) { return htmlentities($value); } class Foo { function html($value) { return htmlentities($value); } } $value = '123'; $object = new Foo(); // 1 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { htmlentities($value); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 2 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 3 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { $object->html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 4 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func('html', $value); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 5 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func(array($object, 'html'), $value); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 6 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array('html', array($value)); } $end = microtime(true); echo (int) (($end - $start) * 1000); // 7 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array(array($object, 'html'), array($value)); } $end = microtime(true); echo (int) (($end - $start) * 1000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 30
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 50
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 70
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 90
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
2 jumps found. (Code = 44) Position 1 = 120, Position 2 = 112
Branch analysis from position: 120
1 jumps found. (Code = 42) Position 1 = 142
Branch analysis from position: 142
2 jumps found. (Code = 44) Position 1 = 144, Position 2 = 134
Branch analysis from position: 144
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 134
2 jumps found. (Code = 44) Position 1 = 144, Position 2 = 134
Branch analysis from position: 144
Branch analysis from position: 134
Branch analysis from position: 112
2 jumps found. (Code = 44) Position 1 = 120, Position 2 = 112
Branch analysis from position: 120
Branch analysis from position: 112
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 90
Branch analysis from position: 98
Branch analysis from position: 90
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 70
Branch analysis from position: 76
Branch analysis from position: 70
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 50
Branch analysis from position: 56
Branch analysis from position: 50
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 30
Branch analysis from position: 36
Branch analysis from position: 30
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 10
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/CehZI
function name:  (null)
number of ops:  153
compiled vars:  !0 = $value, !1 = $object, !2 = $start, !3 = $i, !4 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, '123'
   18     1        NEW                                              $6      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   21     4        INIT_FCALL                                               'microtime'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   22     8        ASSIGN                                                   !3, 1
          9      > JMP                                                      ->14
   23    10    >   INIT_FCALL                                               'htmlentities'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   22    13        PRE_INC                                                  !3
         14    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         15      > JMPNZ                                                    ~14, ->10
   25    16    >   INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   26    20        SUB                                              ~17     !4, !2
         21        MUL                                              ~18     ~17, 1000
         22        CAST                                          4  ~19     ~18
         23        ECHO                                                     ~19
   29    24        INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $20     
         27        ASSIGN                                                   !2, $20
   30    28        ASSIGN                                                   !3, 1
         29      > JMP                                                      ->34
   31    30    >   INIT_FCALL                                               'html'
         31        SEND_VAR                                                 !0
         32        DO_FCALL                                      0          
   30    33        PRE_INC                                                  !3
         34    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         35      > JMPNZ                                                    ~25, ->30
   33    36    >   INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $26     
         39        ASSIGN                                                   !4, $26
   34    40        SUB                                              ~28     !4, !2
         41        MUL                                              ~29     ~28, 1000
         42        CAST                                          4  ~30     ~29
         43        ECHO                                                     ~30
   37    44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $31     
         47        ASSIGN                                                   !2, $31
   38    48        ASSIGN                                                   !3, 1
         49      > JMP                                                      ->54
   39    50    >   INIT_METHOD_CALL                                         !1, 'html'
         51        SEND_VAR_EX                                              !0
         52        DO_FCALL                                      0          
   38    53        PRE_INC                                                  !3
         54    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         55      > JMPNZ                                                    ~36, ->50
   41    56    >   INIT_FCALL                                               'microtime'
         57        SEND_VAL                                                 <true>
         58        DO_ICALL                                         $37     
         59        ASSIGN                                                   !4, $37
   42    60        SUB                                              ~39     !4, !2
         61        MUL                                              ~40     ~39, 1000
         62        CAST                                          4  ~41     ~40
         63        ECHO                                                     ~41
   45    64        INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $42     
         67        ASSIGN                                                   !2, $42
   46    68        ASSIGN                                                   !3, 1
         69      > JMP                                                      ->74
   47    70    >   INIT_FCALL                                               'html'
         71        SEND_USER                                                !0
         72        DO_FCALL                                      0          
   46    73        PRE_INC                                                  !3
         74    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         75      > JMPNZ                                                    ~47, ->70
   49    76    >   INIT_FCALL                                               'microtime'
         77        SEND_VAL                                                 <true>
         78        DO_ICALL                                         $48     
         79        ASSIGN                                                   !4, $48
   50    80        SUB                                              ~50     !4, !2
         81        MUL                                              ~51     ~50, 1000
         82        CAST                                          4  ~52     ~51
         83        ECHO                                                     ~52
   53    84        INIT_FCALL                                               'microtime'
         85        SEND_VAL                                                 <true>
         86        DO_ICALL                                         $53     
         87        ASSIGN                                                   !2, $53
   54    88        ASSIGN                                                   !3, 1
         89      > JMP                                                      ->96
   55    90    >   INIT_ARRAY                                       ~56     !1
         91        ADD_ARRAY_ELEMENT                                ~56     'html'
         92        INIT_USER_CALL                                1          'call_user_func', ~56
         93        SEND_USER                                                !0
         94        DO_FCALL                                      0          
   54    95        PRE_INC                                                  !3
         96    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         97      > JMPNZ                                                    ~59, ->90
   57    98    >   INIT_FCALL                                               'microtime'
         99        SEND_VAL                                                 <true>
        100        DO_ICALL                                         $60     
        101        ASSIGN                                                   !4, $60
   58   102        SUB                                              ~62     !4, !2
        103        MUL                                              ~63     ~62, 1000
        104        CAST                                          4  ~64     ~63
        105        ECHO                                                     ~64
   61   106        INIT_FCALL                                               'microtime'
        107        SEND_VAL                                                 <true>
        108        DO_ICALL                                         $65     
        109        ASSIGN                                                   !2, $65
   62   110        ASSIGN                                                   !3, 1
        111      > JMP                                                      ->118
   63   112    >   INIT_FCALL                                               'html'
        113        INIT_ARRAY                                       ~68     !0
        114        SEND_ARRAY                                               ~68
        115        CHECK_UNDEF_ARGS                                         
        116        DO_FCALL                                      0          
   62   117        PRE_INC                                                  !3
        118    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        119      > JMPNZ                                                    ~71, ->112
   65   120    >   INIT_FCALL                                               'microtime'
        121        SEND_VAL                                                 <true>
        122        DO_ICALL                                         $72     
        123        ASSIGN                                                   !4, $72
   66   124        SUB                                              ~74     !4, !2
        125        MUL                                              ~75     ~74, 1000
        126        CAST                                          4  ~76     ~75
        127        ECHO                                                     ~76
   69   128        INIT_FCALL                                               'microtime'
        129        SEND_VAL                                                 <true>
        130        DO_ICALL                                         $77     
        131        ASSIGN                                                   !2, $77
   70   132        ASSIGN                                                   !3, 1
        133      > JMP                                                      ->142
   71   134    >   INIT_ARRAY                                       ~80     !1
        135        ADD_ARRAY_ELEMENT                                ~80     'html'
        136        INIT_USER_CALL                                0          'call_user_func_array', ~80
        137        INIT_ARRAY                                       ~81     !0
        138        SEND_ARRAY                                               ~81
        139        CHECK_UNDEF_ARGS                                         
        140        DO_FCALL                                      0          
   70   141        PRE_INC                                                  !3
        142    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        143      > JMPNZ                                                    ~84, ->134
   73   144    >   INIT_FCALL                                               'microtime'
        145        SEND_VAL                                                 <true>
        146        DO_ICALL                                         $85     
        147        ASSIGN                                                   !4, $85
   74   148        SUB                                              ~87     !4, !2
        149        MUL                                              ~88     ~87, 1000
        150        CAST                                          4  ~89     ~88
        151        ECHO                                                     ~89
        152      > RETURN                                                   1

Function html:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CehZI
function name:  html
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    6     5*     > RETURN                                                   null

End of function html

Class Foo:
Function html:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CehZI
function name:  html
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   13     5*     > RETURN                                                   null

End of function html

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.14 ms | 1415 KiB | 20 Q