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); var_dump($end - $start); // 2 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { html($value); } $end = microtime(true); var_dump($end - $start); // 3 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { $object->html($value); } $end = microtime(true); var_dump($end - $start); // 4 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func('html', $value); } $end = microtime(true); var_dump($end - $start); // 5 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func(array($object, 'html'), $value); } $end = microtime(true); var_dump($end - $start); // 6 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array('html', array($value)); } $end = microtime(true); var_dump($end - $start); // 7 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func_array(array($object, 'html'), array($value)); } $end = microtime(true); var_dump($end - $start);
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/GlZZN
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        INIT_FCALL                                               'var_dump'
         21        SUB                                              ~17     !4, !2
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                                 
   29    24        INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $19     
         27        ASSIGN                                                   !2, $19
   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                                                    ~24, ->30
   33    36    >   INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $25     
         39        ASSIGN                                                   !4, $25
   34    40        INIT_FCALL                                               'var_dump'
         41        SUB                                              ~27     !4, !2
         42        SEND_VAL                                                 ~27
         43        DO_ICALL                                                 
   37    44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $29     
         47        ASSIGN                                                   !2, $29
   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                                                    ~34, ->50
   41    56    >   INIT_FCALL                                               'microtime'
         57        SEND_VAL                                                 <true>
         58        DO_ICALL                                         $35     
         59        ASSIGN                                                   !4, $35
   42    60        INIT_FCALL                                               'var_dump'
         61        SUB                                              ~37     !4, !2
         62        SEND_VAL                                                 ~37
         63        DO_ICALL                                                 
   45    64        INIT_FCALL                                               'microtime'
         65        SEND_VAL                                                 <true>
         66        DO_ICALL                                         $39     
         67        ASSIGN                                                   !2, $39
   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                                                    ~44, ->70
   49    76    >   INIT_FCALL                                               'microtime'
         77        SEND_VAL                                                 <true>
         78        DO_ICALL                                         $45     
         79        ASSIGN                                                   !4, $45
   50    80        INIT_FCALL                                               'var_dump'
         81        SUB                                              ~47     !4, !2
         82        SEND_VAL                                                 ~47
         83        DO_ICALL                                                 
   53    84        INIT_FCALL                                               'microtime'
         85        SEND_VAL                                                 <true>
         86        DO_ICALL                                         $49     
         87        ASSIGN                                                   !2, $49
   54    88        ASSIGN                                                   !3, 1
         89      > JMP                                                      ->96
   55    90    >   INIT_ARRAY                                       ~52     !1
         91        ADD_ARRAY_ELEMENT                                ~52     'html'
         92        INIT_USER_CALL                                1          'call_user_func', ~52
         93        SEND_USER                                                !0
         94        DO_FCALL                                      0          
   54    95        PRE_INC                                                  !3
         96    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         97      > JMPNZ                                                    ~55, ->90
   57    98    >   INIT_FCALL                                               'microtime'
         99        SEND_VAL                                                 <true>
        100        DO_ICALL                                         $56     
        101        ASSIGN                                                   !4, $56
   58   102        INIT_FCALL                                               'var_dump'
        103        SUB                                              ~58     !4, !2
        104        SEND_VAL                                                 ~58
        105        DO_ICALL                                                 
   61   106        INIT_FCALL                                               'microtime'
        107        SEND_VAL                                                 <true>
        108        DO_ICALL                                         $60     
        109        ASSIGN                                                   !2, $60
   62   110        ASSIGN                                                   !3, 1
        111      > JMP                                                      ->118
   63   112    >   INIT_FCALL                                               'html'
        113        INIT_ARRAY                                       ~63     !0
        114        SEND_ARRAY                                               ~63
        115        CHECK_UNDEF_ARGS                                         
        116        DO_FCALL                                      0          
   62   117        PRE_INC                                                  !3
        118    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        119      > JMPNZ                                                    ~66, ->112
   65   120    >   INIT_FCALL                                               'microtime'
        121        SEND_VAL                                                 <true>
        122        DO_ICALL                                         $67     
        123        ASSIGN                                                   !4, $67
   66   124        INIT_FCALL                                               'var_dump'
        125        SUB                                              ~69     !4, !2
        126        SEND_VAL                                                 ~69
        127        DO_ICALL                                                 
   69   128        INIT_FCALL                                               'microtime'
        129        SEND_VAL                                                 <true>
        130        DO_ICALL                                         $71     
        131        ASSIGN                                                   !2, $71
   70   132        ASSIGN                                                   !3, 1
        133      > JMP                                                      ->142
   71   134    >   INIT_ARRAY                                       ~74     !1
        135        ADD_ARRAY_ELEMENT                                ~74     'html'
        136        INIT_USER_CALL                                0          'call_user_func_array', ~74
        137        INIT_ARRAY                                       ~75     !0
        138        SEND_ARRAY                                               ~75
        139        CHECK_UNDEF_ARGS                                         
        140        DO_FCALL                                      0          
   70   141        PRE_INC                                                  !3
        142    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        143      > JMPNZ                                                    ~78, ->134
   73   144    >   INIT_FCALL                                               'microtime'
        145        SEND_VAL                                                 <true>
        146        DO_ICALL                                         $79     
        147        ASSIGN                                                   !4, $79
   74   148        INIT_FCALL                                               'var_dump'
        149        SUB                                              ~81     !4, !2
        150        SEND_VAL                                                 ~81
        151        DO_ICALL                                                 
        152      > RETURN                                                   1

Function html:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GlZZN
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/GlZZN
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:
158.8 ms | 1415 KiB | 22 Q