3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $time1 = microtime(true); for ($k = 0; $k<1000000; $k++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } $time2 = microtime(true); $testDuration1 = $time2 - $time1; echo "Test 1 took $testDuration1 Seconds"; $time3 = microtime(true); for ($m = 0; $m<1000000; $m++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } $time4 = microtime(true); $testDuration2 = $time4 - $time3; echo "Test 2 took $testDuration2 Seconds"; $time5 = microtime(true); for ($p = 0; $p<1000000; $p++) { $concatTest3 = implode('', array($string1, $string2, $string3, $string4, $string5)); } $time6 = microtime(true); $testDuration3 = $time6 - $time5; echo "Test 3 took $testDuration3 Seconds";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 35
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 60
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 73, Position 2 = 60
Branch analysis from position: 73
Branch analysis from position: 60
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 35
Branch analysis from position: 44
Branch analysis from position: 35
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 11
Branch analysis from position: 19
Branch analysis from position: 11
filename:       /in/TdlJu
function name:  (null)
number of ops:  84
compiled vars:  !0 = $string1, !1 = $string2, !2 = $string3, !3 = $string4, !4 = $string5, !5 = $time1, !6 = $k, !7 = $concatTest1, !8 = $time2, !9 = $testDuration1, !10 = $time3, !11 = $m, !12 = $concatTest2, !13 = $time4, !14 = $testDuration2, !15 = $time5, !16 = $p, !17 = $concatTest3, !18 = $time6, !19 = $testDuration3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'aaaaaaaaaaaaaaaaaaaa'
    4     1        ASSIGN                                                   !1, 'bbbbbbbbbbbbbbbbbbbb'
    5     2        ASSIGN                                                   !2, 'cccccccccccccccccccc'
    6     3        ASSIGN                                                   !3, 'dddddddddddddddddddd'
    7     4        ASSIGN                                                   !4, 'eeeeeeeeeeeeeeeeeeee'
   10     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $25     
          8        ASSIGN                                                   !5, $25
   11     9        ASSIGN                                                   !6, 0
         10      > JMP                                                      ->17
   12    11    >   CONCAT                                           ~28     !0, !1
         12        CONCAT                                           ~29     ~28, !2
         13        CONCAT                                           ~30     ~29, !3
         14        CONCAT                                           ~31     ~30, !4
         15        ASSIGN                                                   !7, ~31
   11    16        PRE_INC                                                  !6
         17    >   IS_SMALLER                                               !6, 1000000
         18      > JMPNZ                                                    ~34, ->11
   14    19    >   INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $35     
         22        ASSIGN                                                   !8, $35
   16    23        SUB                                              ~37     !8, !5
         24        ASSIGN                                                   !9, ~37
   17    25        ROPE_INIT                                     3  ~40     'Test+1+took+'
         26        ROPE_ADD                                      1  ~40     ~40, !9
         27        ROPE_END                                      2  ~39     ~40, '+Seconds'
         28        ECHO                                                     ~39
   19    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $42     
         32        ASSIGN                                                   !10, $42
   20    33        ASSIGN                                                   !11, 0
         34      > JMP                                                      ->42
   21    35    >   ROPE_INIT                                     5  ~46     !0
         36        ROPE_ADD                                      1  ~46     ~46, !1
         37        ROPE_ADD                                      2  ~46     ~46, !2
         38        ROPE_ADD                                      3  ~46     ~46, !3
         39        ROPE_END                                      4  ~45     ~46, !4
         40        ASSIGN                                                   !12, ~45
   20    41        PRE_INC                                                  !11
         42    >   IS_SMALLER                                               !11, 1000000
         43      > JMPNZ                                                    ~51, ->35
   23    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $52     
         47        ASSIGN                                                   !13, $52
   25    48        SUB                                              ~54     !13, !10
         49        ASSIGN                                                   !14, ~54
   26    50        ROPE_INIT                                     3  ~57     'Test+2+took+'
         51        ROPE_ADD                                      1  ~57     ~57, !14
         52        ROPE_END                                      2  ~56     ~57, '+Seconds'
         53        ECHO                                                     ~56
   29    54        INIT_FCALL                                               'microtime'
         55        SEND_VAL                                                 <true>
         56        DO_ICALL                                         $59     
         57        ASSIGN                                                   !15, $59
   30    58        ASSIGN                                                   !16, 0
         59      > JMP                                                      ->71
   31    60    >   INIT_FCALL                                               'implode'
         61        SEND_VAL                                                 ''
         62        INIT_ARRAY                                       ~62     !0
         63        ADD_ARRAY_ELEMENT                                ~62     !1
         64        ADD_ARRAY_ELEMENT                                ~62     !2
         65        ADD_ARRAY_ELEMENT                                ~62     !3
         66        ADD_ARRAY_ELEMENT                                ~62     !4
         67        SEND_VAL                                                 ~62
         68        DO_ICALL                                         $63     
         69        ASSIGN                                                   !17, $63
   30    70        PRE_INC                                                  !16
         71    >   IS_SMALLER                                               !16, 1000000
         72      > JMPNZ                                                    ~66, ->60
   33    73    >   INIT_FCALL                                               'microtime'
         74        SEND_VAL                                                 <true>
         75        DO_ICALL                                         $67     
         76        ASSIGN                                                   !18, $67
   35    77        SUB                                              ~69     !18, !15
         78        ASSIGN                                                   !19, ~69
   36    79        ROPE_INIT                                     3  ~72     'Test+3+took+'
         80        ROPE_ADD                                      1  ~72     ~72, !19
         81        ROPE_END                                      2  ~71     ~72, '+Seconds'
         82        ECHO                                                     ~71
         83      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.98 ms | 1404 KiB | 17 Q