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) . "\n"; // 2 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 3 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { $object->html($value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 4 $start = microtime(true); for ($i = 1; $i <= 100000; $i++) { call_user_func('html', $value); } $end = microtime(true); echo (int) (($end - $start) * 1000) . "\n"; // 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) . "\n"; // 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) . "\n"; // 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) . "\n";
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 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 31
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 52
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 73
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
2 jumps found. (Code = 44) Position 1 = 102, Position 2 = 94
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 123
Branch analysis from position: 123
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 117
Branch analysis from position: 125
1 jumps found. (Code = 42) Position 1 = 148
Branch analysis from position: 148
2 jumps found. (Code = 44) Position 1 = 150, Position 2 = 140
Branch analysis from position: 150
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 140
2 jumps found. (Code = 44) Position 1 = 150, Position 2 = 140
Branch analysis from position: 150
Branch analysis from position: 140
Branch analysis from position: 117
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 117
Branch analysis from position: 125
Branch analysis from position: 117
Branch analysis from position: 94
2 jumps found. (Code = 44) Position 1 = 102, Position 2 = 94
Branch analysis from position: 102
Branch analysis from position: 94
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 73
Branch analysis from position: 79
Branch analysis from position: 73
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 52
Branch analysis from position: 58
Branch analysis from position: 52
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 31
Branch analysis from position: 37
Branch analysis from position: 31
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/7nkZq
function name:  (null)
number of ops:  160
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        CONCAT                                           ~20     ~19, '%0A'
         24        ECHO                                                     ~20
   29    25        INIT_FCALL                                               'microtime'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $21     
         28        ASSIGN                                                   !2, $21
   30    29        ASSIGN                                                   !3, 1
         30      > JMP                                                      ->35
   31    31    >   INIT_FCALL                                               'html'
         32        SEND_VAR                                                 !0
         33        DO_FCALL                                      0          
   30    34        PRE_INC                                                  !3
         35    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         36      > JMPNZ                                                    ~26, ->31
   33    37    >   INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $27     
         40        ASSIGN                                                   !4, $27
   34    41        SUB                                              ~29     !4, !2
         42        MUL                                              ~30     ~29, 1000
         43        CAST                                          4  ~31     ~30
         44        CONCAT                                           ~32     ~31, '%0A'
         45        ECHO                                                     ~32
   37    46        INIT_FCALL                                               'microtime'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $33     
         49        ASSIGN                                                   !2, $33
   38    50        ASSIGN                                                   !3, 1
         51      > JMP                                                      ->56
   39    52    >   INIT_METHOD_CALL                                         !1, 'html'
         53        SEND_VAR_EX                                              !0
         54        DO_FCALL                                      0          
   38    55        PRE_INC                                                  !3
         56    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         57      > JMPNZ                                                    ~38, ->52
   41    58    >   INIT_FCALL                                               'microtime'
         59        SEND_VAL                                                 <true>
         60        DO_ICALL                                         $39     
         61        ASSIGN                                                   !4, $39
   42    62        SUB                                              ~41     !4, !2
         63        MUL                                              ~42     ~41, 1000
         64        CAST                                          4  ~43     ~42
         65        CONCAT                                           ~44     ~43, '%0A'
         66        ECHO                                                     ~44
   45    67        INIT_FCALL                                               'microtime'
         68        SEND_VAL                                                 <true>
         69        DO_ICALL                                         $45     
         70        ASSIGN                                                   !2, $45
   46    71        ASSIGN                                                   !3, 1
         72      > JMP                                                      ->77
   47    73    >   INIT_FCALL                                               'html'
         74        SEND_USER                                                !0
         75        DO_FCALL                                      0          
   46    76        PRE_INC                                                  !3
         77    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
         78      > JMPNZ                                                    ~50, ->73
   49    79    >   INIT_FCALL                                               'microtime'
         80        SEND_VAL                                                 <true>
         81        DO_ICALL                                         $51     
         82        ASSIGN                                                   !4, $51
   50    83        SUB                                              ~53     !4, !2
         84        MUL                                              ~54     ~53, 1000
         85        CAST                                          4  ~55     ~54
         86        CONCAT                                           ~56     ~55, '%0A'
         87        ECHO                                                     ~56
   53    88        INIT_FCALL                                               'microtime'
         89        SEND_VAL                                                 <true>
         90        DO_ICALL                                         $57     
         91        ASSIGN                                                   !2, $57
   54    92        ASSIGN                                                   !3, 1
         93      > JMP                                                      ->100
   55    94    >   INIT_ARRAY                                       ~60     !1
         95        ADD_ARRAY_ELEMENT                                ~60     'html'
         96        INIT_USER_CALL                                1          'call_user_func', ~60
         97        SEND_USER                                                !0
         98        DO_FCALL                                      0          
   54    99        PRE_INC                                                  !3
        100    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        101      > JMPNZ                                                    ~63, ->94
   57   102    >   INIT_FCALL                                               'microtime'
        103        SEND_VAL                                                 <true>
        104        DO_ICALL                                         $64     
        105        ASSIGN                                                   !4, $64
   58   106        SUB                                              ~66     !4, !2
        107        MUL                                              ~67     ~66, 1000
        108        CAST                                          4  ~68     ~67
        109        CONCAT                                           ~69     ~68, '%0A'
        110        ECHO                                                     ~69
   61   111        INIT_FCALL                                               'microtime'
        112        SEND_VAL                                                 <true>
        113        DO_ICALL                                         $70     
        114        ASSIGN                                                   !2, $70
   62   115        ASSIGN                                                   !3, 1
        116      > JMP                                                      ->123
   63   117    >   INIT_FCALL                                               'html'
        118        INIT_ARRAY                                       ~73     !0
        119        SEND_ARRAY                                               ~73
        120        CHECK_UNDEF_ARGS                                         
        121        DO_FCALL                                      0          
   62   122        PRE_INC                                                  !3
        123    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        124      > JMPNZ                                                    ~76, ->117
   65   125    >   INIT_FCALL                                               'microtime'
        126        SEND_VAL                                                 <true>
        127        DO_ICALL                                         $77     
        128        ASSIGN                                                   !4, $77
   66   129        SUB                                              ~79     !4, !2
        130        MUL                                              ~80     ~79, 1000
        131        CAST                                          4  ~81     ~80
        132        CONCAT                                           ~82     ~81, '%0A'
        133        ECHO                                                     ~82
   69   134        INIT_FCALL                                               'microtime'
        135        SEND_VAL                                                 <true>
        136        DO_ICALL                                         $83     
        137        ASSIGN                                                   !2, $83
   70   138        ASSIGN                                                   !3, 1
        139      > JMP                                                      ->148
   71   140    >   INIT_ARRAY                                       ~86     !1
        141        ADD_ARRAY_ELEMENT                                ~86     'html'
        142        INIT_USER_CALL                                0          'call_user_func_array', ~86
        143        INIT_ARRAY                                       ~87     !0
        144        SEND_ARRAY                                               ~87
        145        CHECK_UNDEF_ARGS                                         
        146        DO_FCALL                                      0          
   70   147        PRE_INC                                                  !3
        148    >   IS_SMALLER_OR_EQUAL                                      !3, 100000
        149      > JMPNZ                                                    ~90, ->140
   73   150    >   INIT_FCALL                                               'microtime'
        151        SEND_VAL                                                 <true>
        152        DO_ICALL                                         $91     
        153        ASSIGN                                                   !4, $91
   74   154        SUB                                              ~93     !4, !2
        155        MUL                                              ~94     ~93, 1000
        156        CAST                                          4  ~95     ~94
        157        CONCAT                                           ~96     ~95, '%0A'
        158        ECHO                                                     ~96
        159      > RETURN                                                   1

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