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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.65 ms | 1428 KiB | 23 Q