3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Only strings: ", ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test','this is a test','this is a test','this is a test','this is a test','this is a test'; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.'this is a test'.'this is a test'.'this is a test'.'this is a test'.'this is a test'; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ', delta= ', round(($d - $c) * 100 / $d, 1), "%\n"; echo "With vars: ", ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',$i,'this is a test',$i,'this is a test',$i; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.$i.'this is a test'.$i.'this is a test'.$i; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ', delta= ', round(($d - $c) * 100 / $d, 1), "%\n"; echo "With array: "; $A = array('a' => 'A', 'b' => 'B', 'c' => 'C'); ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',$A['a'],'this is a test',$A['b'],'this is a test',$A['c']; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.$A['a'].'this is a test'.$A['b'].'this is a test'.$A['c']; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ', delta= ', round(($d - $c) * 100 / $d, 1), "%\n"; echo "With array & function: "; $A = array('a' => 'A', 'b' => 'B', 'c' => 'C'); ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',ss($A['a']),'this is a test',ss($A['b']),'this is a test',ss($A['c']); $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.ss($A['a']).'this is a test'.ss($A['b']).'this is a test'.ss($A['c']); $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ', delta= ', round(($d - $c) * 100 / $d, 1), "%\n"; function ss($s) { return substr($s, 0); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 43
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 83
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 116
Branch analysis from position: 125
1 jumps found. (Code = 42) Position 1 = 170
Branch analysis from position: 170
2 jumps found. (Code = 44) Position 1 = 173, Position 2 = 161
Branch analysis from position: 173
1 jumps found. (Code = 42) Position 1 = 206
Branch analysis from position: 206
2 jumps found. (Code = 44) Position 1 = 209, Position 2 = 197
Branch analysis from position: 209
1 jumps found. (Code = 42) Position 1 = 266
Branch analysis from position: 266
2 jumps found. (Code = 44) Position 1 = 269, Position 2 = 245
Branch analysis from position: 269
1 jumps found. (Code = 42) Position 1 = 314
Branch analysis from position: 314
2 jumps found. (Code = 44) Position 1 = 317, Position 2 = 293
Branch analysis from position: 317
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 293
2 jumps found. (Code = 44) Position 1 = 317, Position 2 = 293
Branch analysis from position: 317
Branch analysis from position: 293
Branch analysis from position: 245
2 jumps found. (Code = 44) Position 1 = 269, Position 2 = 245
Branch analysis from position: 269
Branch analysis from position: 245
Branch analysis from position: 197
2 jumps found. (Code = 44) Position 1 = 209, Position 2 = 197
Branch analysis from position: 209
Branch analysis from position: 197
Branch analysis from position: 161
2 jumps found. (Code = 44) Position 1 = 173, Position 2 = 161
Branch analysis from position: 173
Branch analysis from position: 161
Branch analysis from position: 116
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 116
Branch analysis from position: 125
Branch analysis from position: 116
Branch analysis from position: 83
2 jumps found. (Code = 44) Position 1 = 92, Position 2 = 83
Branch analysis from position: 92
Branch analysis from position: 83
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 43
Branch analysis from position: 47
Branch analysis from position: 43
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/2InDY
function name:  (null)
number of ops:  344
compiled vars:  !0 = $i, !1 = $time0, !2 = $time1, !3 = $c, !4 = $d, !5 = $A
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Only+strings%3A+'
    4     1        INIT_FCALL                                               'ob_start'
          2        DO_ICALL                                         $6      
          3        ECHO                                                     $6
    5     4        ASSIGN                                                   !0, 0
    6     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    7     9      > JMP                                                      ->16
         10    >   ECHO                                                     'this+is+a+test'
         11        ECHO                                                     'this+is+a+test'
         12        ECHO                                                     'this+is+a+test'
         13        ECHO                                                     'this+is+a+test'
         14        ECHO                                                     'this+is+a+test'
         15        ECHO                                                     'this+is+a+test'
         16    >   POST_INC                                         ~10     !0
         17        IS_SMALLER                                               ~10, 100000
         18      > JMPNZ                                                    ~11, ->10
    8    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 1
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !2, $12
    9    23        INIT_FCALL                                               'ob_end_clean'
         24        DO_ICALL                                                 
   10    25        ECHO                                                     'comma%3D'
         26        INIT_FCALL                                               'round'
         27        SUB                                              ~15     !2, !1
         28        MUL                                              ~16     ~15, 1000
         29        ASSIGN                                           ~17     !3, ~16
         30        SEND_VAL                                                 ~17
         31        SEND_VAL                                                 3
         32        DO_ICALL                                         $18     
         33        ECHO                                                     $18
         34        ECHO                                                     'ms'
   12    35        INIT_FCALL                                               'ob_start'
         36        DO_ICALL                                                 
   13    37        ASSIGN                                                   !0, 0
   14    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 1
         40        DO_ICALL                                         $21     
         41        ASSIGN                                                   !1, $21
   15    42      > JMP                                                      ->44
         43    >   ECHO                                                     'this+is+a+testthis+is+a+testthis+is+a+testthis+is+a+testthis+is+a+testthis+is+a+test'
         44    >   POST_INC                                         ~23     !0
         45        IS_SMALLER                                               ~23, 100000
         46      > JMPNZ                                                    ~24, ->43
   16    47    >   INIT_FCALL                                               'microtime'
         48        SEND_VAL                                                 1
         49        DO_ICALL                                         $25     
         50        ASSIGN                                                   !2, $25
   17    51        INIT_FCALL                                               'ob_end_clean'
         52        DO_ICALL                                                 
   18    53        ECHO                                                     '%2C+dot%3D'
         54        INIT_FCALL                                               'round'
         55        SUB                                              ~28     !2, !1
         56        MUL                                              ~29     ~28, 1000
         57        ASSIGN                                           ~30     !4, ~29
         58        SEND_VAL                                                 ~30
         59        SEND_VAL                                                 3
         60        DO_ICALL                                         $31     
         61        ECHO                                                     $31
         62        ECHO                                                     'ms'
   20    63        ECHO                                                     '%2C+delta%3D+'
         64        INIT_FCALL                                               'round'
         65        SUB                                              ~32     !4, !3
         66        MUL                                              ~33     ~32, 100
         67        DIV                                              ~34     ~33, !4
         68        SEND_VAL                                                 ~34
         69        SEND_VAL                                                 1
         70        DO_ICALL                                         $35     
         71        ECHO                                                     $35
         72        ECHO                                                     '%25%0A'
   22    73        ECHO                                                     'With+vars%3A+'
   24    74        INIT_FCALL                                               'ob_start'
         75        DO_ICALL                                         $36     
         76        ECHO                                                     $36
   25    77        ASSIGN                                                   !0, 0
   26    78        INIT_FCALL                                               'microtime'
         79        SEND_VAL                                                 1
         80        DO_ICALL                                         $38     
         81        ASSIGN                                                   !1, $38
   27    82      > JMP                                                      ->89
         83    >   ECHO                                                     'this+is+a+test'
         84        ECHO                                                     !0
         85        ECHO                                                     'this+is+a+test'
         86        ECHO                                                     !0
         87        ECHO                                                     'this+is+a+test'
         88        ECHO                                                     !0
         89    >   POST_INC                                         ~40     !0
         90        IS_SMALLER                                               ~40, 100000
         91      > JMPNZ                                                    ~41, ->83
   28    92    >   INIT_FCALL                                               'microtime'
         93        SEND_VAL                                                 1
         94        DO_ICALL                                         $42     
         95        ASSIGN                                                   !2, $42
   29    96        INIT_FCALL                                               'ob_end_clean'
         97        DO_ICALL                                                 
   30    98        ECHO                                                     'comma%3D'
         99        INIT_FCALL                                               'round'
        100        SUB                                              ~45     !2, !1
        101        MUL                                              ~46     ~45, 1000
        102        ASSIGN                                           ~47     !3, ~46
        103        SEND_VAL                                                 ~47
        104        SEND_VAL                                                 3
        105        DO_ICALL                                         $48     
        106        ECHO                                                     $48
        107        ECHO                                                     'ms'
   32   108        INIT_FCALL                                               'ob_start'
        109        DO_ICALL                                                 
   33   110        ASSIGN                                                   !0, 0
   34   111        INIT_FCALL                                               'microtime'
        112        SEND_VAL                                                 1
        113        DO_ICALL                                         $51     
        114        ASSIGN                                                   !1, $51
   35   115      > JMP                                                      ->122
        116    >   CONCAT                                           ~53     'this+is+a+test', !0
        117        CONCAT                                           ~54     ~53, 'this+is+a+test'
        118        CONCAT                                           ~55     ~54, !0
        119        CONCAT                                           ~56     ~55, 'this+is+a+test'
        120        CONCAT                                           ~57     ~56, !0
        121        ECHO                                                     ~57
        122    >   POST_INC                                         ~58     !0
        123        IS_SMALLER                                               ~58, 100000
        124      > JMPNZ                                                    ~59, ->116
   36   125    >   INIT_FCALL                                               'microtime'
        126        SEND_VAL                                                 1
        127        DO_ICALL                                         $60     
        128        ASSIGN                                                   !2, $60
   37   129        INIT_FCALL                                               'ob_end_clean'
        130        DO_ICALL                                                 
   38   131        ECHO                                                     '%2C+dot%3D'
        132        INIT_FCALL                                               'round'
        133        SUB                                              ~63     !2, !1
        134        MUL                                              ~64     ~63, 1000
        135        ASSIGN                                           ~65     !4, ~64
        136        SEND_VAL                                                 ~65
        137        SEND_VAL                                                 3
        138        DO_ICALL                                         $66     
        139        ECHO                                                     $66
        140        ECHO                                                     'ms'
   40   141        ECHO                                                     '%2C+delta%3D+'
        142        INIT_FCALL                                               'round'
        143        SUB                                              ~67     !4, !3
        144        MUL                                              ~68     ~67, 100
        145        DIV                                              ~69     ~68, !4
        146        SEND_VAL                                                 ~69
        147        SEND_VAL                                                 1
        148        DO_ICALL                                         $70     
        149        ECHO                                                     $70
        150        ECHO                                                     '%25%0A'
   42   151        ECHO                                                     'With+array%3A+'
   44   152        ASSIGN                                                   !5, <array>
   46   153        INIT_FCALL                                               'ob_start'
        154        DO_ICALL                                                 
   47   155        ASSIGN                                                   !0, 0
   48   156        INIT_FCALL                                               'microtime'
        157        SEND_VAL                                                 1
        158        DO_ICALL                                         $74     
        159        ASSIGN                                                   !1, $74
   49   160      > JMP                                                      ->170
        161    >   ECHO                                                     'this+is+a+test'
        162        FETCH_DIM_R                                      ~76     !5, 'a'
        163        ECHO                                                     ~76
        164        ECHO                                                     'this+is+a+test'
        165        FETCH_DIM_R                                      ~77     !5, 'b'
        166        ECHO                                                     ~77
        167        ECHO                                                     'this+is+a+test'
        168        FETCH_DIM_R                                      ~78     !5, 'c'
        169        ECHO                                                     ~78
        170    >   POST_INC                                         ~79     !0
        171        IS_SMALLER                                               ~79, 100000
        172      > JMPNZ                                                    ~80, ->161
   50   173    >   INIT_FCALL                                               'microtime'
        174        SEND_VAL                                                 1
        175        DO_ICALL                                         $81     
        176        ASSIGN                                                   !2, $81
   51   177        INIT_FCALL                                               'ob_end_clean'
        178        DO_ICALL                                                 
   52   179        ECHO                                                     'comma%3D'
        180        INIT_FCALL                                               'round'
        181        SUB                                              ~84     !2, !1
        182        MUL                                              ~85     ~84, 1000
        183        ASSIGN                                           ~86     !3, ~85
        184        SEND_VAL                                                 ~86
        185        SEND_VAL                                                 3
        186        DO_ICALL                                         $87     
        187        ECHO                                                     $87
        188        ECHO                                                     'ms'
   54   189        INIT_FCALL                                               'ob_start'
        190        DO_ICALL                                                 
   55   191        ASSIGN                                                   !0, 0
   56   192        INIT_FCALL                                               'microtime'
        193        SEND_VAL                                                 1
        194        DO_ICALL                                         $90     
        195        ASSIGN                                                   !1, $90
   57   196      > JMP                                                      ->206
        197    >   FETCH_DIM_R                                      ~92     !5, 'a'
        198        CONCAT                                           ~93     'this+is+a+test', ~92
        199        CONCAT                                           ~94     ~93, 'this+is+a+test'
        200        FETCH_DIM_R                                      ~95     !5, 'b'
        201        CONCAT                                           ~96     ~94, ~95
        202        CONCAT                                           ~97     ~96, 'this+is+a+test'
        203        FETCH_DIM_R                                      ~98     !5, 'c'
        204        CONCAT                                           ~99     ~97, ~98
        205        ECHO                                                     ~99
        206    >   POST_INC                                         ~100    !0
        207        IS_SMALLER                                               ~100, 100000
        208      > JMPNZ                                                    ~101, ->197
   58   209    >   INIT_FCALL                                               'microtime'
        210        SEND_VAL                                                 1
        211        DO_ICALL                                         $102    
        212        ASSIGN                                                   !2, $102
   59   213        INIT_FCALL                                               'ob_end_clean'
        214        DO_ICALL                                                 
   60   215        ECHO                                                     '%2C+dot%3D'
        216        INIT_FCALL                                               'round'
        217        SUB                                              ~105    !2, !1
        218        MUL                                              ~106    ~105, 1000
        219        ASSIGN                                           ~107    !4, ~106
        220        SEND_VAL                                                 ~107
        221        SEND_VAL                                                 3
        222        DO_ICALL                                         $108    
        223        ECHO                                                     $108
        224        ECHO                                                     'ms'
   62   225        ECHO                                                     '%2C+delta%3D+'
        226        INIT_FCALL                                               'round'
        227        SUB                                              ~109    !4, !3
        228        MUL                                              ~110    ~109, 100
        229        DIV                                              ~111    ~110, !4
        230        SEND_VAL                                                 ~111
        231        SEND_VAL                                                 1
        232        DO_ICALL                                         $112    
        233        ECHO                                                     $112
        234        ECHO                                                     '%25%0A'
   64   235        ECHO                                                     'With+array+%26+function%3A+'
   66   236        ASSIGN                                                   !5, <array>
   68   237        INIT_FCALL                                               'ob_start'
        238        DO_ICALL                                                 
   69   239        ASSIGN                                                   !0, 0
   70   240        INIT_FCALL                                               'microtime'
        241        SEND_VAL                                                 1
        242        DO_ICALL                                         $116    
        243        ASSIGN                                                   !1, $116
   71   244      > JMP                                                      ->266
        245    >   ECHO                                                     'this+is+a+test'
        246        INIT_FCALL_BY_NAME                                       'ss'
        247        CHECK_FUNC_ARG                                           
        248        FETCH_DIM_FUNC_ARG                               $118    !5, 'a'
        249        SEND_FUNC_ARG                                            $118
        250        DO_FCALL                                      0  $119    
        251        ECHO                                                     $119
        252        ECHO                                                     'this+is+a+test'
        253        INIT_FCALL_BY_NAME                                       'ss'
        254        CHECK_FUNC_ARG                                           
        255        FETCH_DIM_FUNC_ARG                               $120    !5, 'b'
        256        SEND_FUNC_ARG                                            $120
        257        DO_FCALL                                      0  $121    
        258        ECHO                                                     $121
        259        ECHO                                                     'this+is+a+test'
        260        INIT_FCALL_BY_NAME                                       'ss'
        261        CHECK_FUNC_ARG                                           
        262        FETCH_DIM_FUNC_ARG                               $122    !5, 'c'
        263        SEND_FUNC_ARG                                            $122
        264        DO_FCALL                                      0  $123    
        265        ECHO                                                     $123
        266    >   POST_INC                                         ~124    !0
        267        IS_SMALLER                                               ~124, 100000
        268      > JMPNZ                                                    ~125, ->245
   72   269    >   INIT_FCALL                                               'microtime'
        270        SEND_VAL                                                 1
        271        DO_ICALL                                         $126    
        272        ASSIGN                                                   !2, $126
   73   273        INIT_FCALL                                               'ob_end_clean'
        274        DO_ICALL                                                 
   74   275        ECHO                                                     'comma%3D'
        276        INIT_FCALL                                               'round'
        277        SUB                                              ~129    !2, !1
        278        MUL                                              ~130    ~129, 1000
        279        ASSIGN                                           ~131    !3, ~130
        280        SEND_VAL                                                 ~131
        281        SEND_VAL                                                 3
        282        DO_ICALL                                         $132    
        283        ECHO                                                     $132
        284        ECHO                                                     'ms'
   76   285        INIT_FCALL                                               'ob_start'
        286        DO_ICALL                                                 
   77   287        ASSIGN                                                   !0, 0
   78   288        INIT_FCALL                                               'microtime'
        289        SEND_VAL                                                 1
        290        DO_ICALL                                         $135    
        291        ASSIGN                                                   !1, $135
   79   292      > JMP                                                      ->314
        293    >   INIT_FCALL_BY_NAME                                       'ss'
        294        CHECK_FUNC_ARG                                           
        295        FETCH_DIM_FUNC_ARG                               $137    !5, 'a'
        296        SEND_FUNC_ARG                                            $137
        297        DO_FCALL                                      0  $138    
        298        CONCAT                                           ~139    'this+is+a+test', $138
        299        CONCAT                                           ~140    ~139, 'this+is+a+test'
        300        INIT_FCALL_BY_NAME                                       'ss'
        301        CHECK_FUNC_ARG                                           
        302        FETCH_DIM_FUNC_ARG                               $141    !5, 'b'
        303        SEND_FUNC_ARG                                            $141
        304        DO_FCALL                                      0  $142    
        305        CONCAT                                           ~143    ~140, $142
        306        CONCAT                                           ~144    ~143, 'this+is+a+test'
        307        INIT_FCALL_BY_NAME                                       'ss'
        308        CHECK_FUNC_ARG                                           
        309        FETCH_DIM_FUNC_ARG                               $145    !5, 'c'
        310        SEND_FUNC_ARG                                            $145
        311        DO_FCALL                                      0  $146    
        312        CONCAT                                           ~147    ~144, $146
        313        ECHO                                                     ~147
        314    >   POST_INC                                         ~148    !0
        315        IS_SMALLER                                               ~148, 100000
        316      > JMPNZ                                                    ~149, ->293
   80   317    >   INIT_FCALL                                               'microtime'
        318        SEND_VAL                                                 1
        319        DO_ICALL                                         $150    
        320        ASSIGN                                                   !2, $150
   81   321        INIT_FCALL                                               'ob_end_clean'
        322        DO_ICALL                                                 
   82   323        ECHO                                                     '%2C+dot%3D'
        324        INIT_FCALL                                               'round'
        325        SUB                                              ~153    !2, !1
        326        MUL                                              ~154    ~153, 1000
        327        ASSIGN                                           ~155    !4, ~154
        328        SEND_VAL                                                 ~155
        329        SEND_VAL                                                 3
        330        DO_ICALL                                         $156    
        331        ECHO                                                     $156
        332        ECHO                                                     'ms'
   84   333        ECHO                                                     '%2C+delta%3D+'
        334        INIT_FCALL                                               'round'
        335        SUB                                              ~157    !4, !3
        336        MUL                                              ~158    ~157, 100
        337        DIV                                              ~159    ~158, !4
        338        SEND_VAL                                                 ~159
        339        SEND_VAL                                                 1
        340        DO_ICALL                                         $160    
        341        ECHO                                                     $160
        342        ECHO                                                     '%25%0A'
   88   343      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.14 ms | 1428 KiB | 23 Q