3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $results = array(); $time1 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } unset($i); $time2 = microtime(true); $testDuration1 = $time2 - $time1; $results['Test1'] = $testDuration1; $time3 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } unset($i); $time4 = microtime(true); $testDuration2 = $time4 - $time3; $results['Test2'] = $testDuration2; $time5 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest3 = implode('', array( $string1, $string2, $string3, $string4, $string5 )); } unset($i); $time6 = microtime(true); $testDuration3 = $time6 - $time5; $results['Test3'] = $testDuration3; $time7 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest4 = sprintf('%s%s%s%s%s', $string1, $string2, $string3, $string4, $string5 ); } unset($i); $time8 = microtime(true); $testDuration4 = $time8 - $time7; $results['Test4'] = $testDuration4; sort($results); var_dump($results);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 12
Branch analysis from position: 20
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 = 70
Branch analysis from position: 70
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 59
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 87
Branch analysis from position: 99
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 87
Branch analysis from position: 99
Branch analysis from position: 87
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 72, Position 2 = 59
Branch analysis from position: 72
Branch analysis from position: 59
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: 12
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 12
Branch analysis from position: 20
Branch analysis from position: 12
filename:       /in/mKvZ5
function name:  (null)
number of ops:  115
compiled vars:  !0 = $string1, !1 = $string2, !2 = $string3, !3 = $string4, !4 = $string5, !5 = $results, !6 = $time1, !7 = $i, !8 = $concatTest1, !9 = $time2, !10 = $testDuration1, !11 = $time3, !12 = $concatTest2, !13 = $time4, !14 = $testDuration2, !15 = $time5, !16 = $concatTest3, !17 = $time6, !18 = $testDuration3, !19 = $time7, !20 = $concatTest4, !21 = $time8, !22 = $testDuration4
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        ASSIGN                                                   !5, <array>
   12     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $29     
          9        ASSIGN                                                   !6, $29
   13    10        ASSIGN                                                   !7, 0
         11      > JMP                                                      ->18
   14    12    >   CONCAT                                           ~32     !0, !1
         13        CONCAT                                           ~33     ~32, !2
         14        CONCAT                                           ~34     ~33, !3
         15        CONCAT                                           ~35     ~34, !4
         16        ASSIGN                                                   !8, ~35
   13    17        PRE_INC                                                  !7
         18    >   IS_SMALLER                                               !7, 1000000
         19      > JMPNZ                                                    ~38, ->12
   16    20    >   UNSET_CV                                                 !7
   17    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $39     
         24        ASSIGN                                                   !9, $39
   18    25        SUB                                              ~41     !9, !6
         26        ASSIGN                                                   !10, ~41
   19    27        ASSIGN_DIM                                               !5, 'Test1'
         28        OP_DATA                                                  !10
   21    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $44     
         32        ASSIGN                                                   !11, $44
   22    33        ASSIGN                                                   !7, 0
         34      > JMP                                                      ->42
   23    35    >   ROPE_INIT                                     5  ~48     !0
         36        ROPE_ADD                                      1  ~48     ~48, !1
         37        ROPE_ADD                                      2  ~48     ~48, !2
         38        ROPE_ADD                                      3  ~48     ~48, !3
         39        ROPE_END                                      4  ~47     ~48, !4
         40        ASSIGN                                                   !12, ~47
   22    41        PRE_INC                                                  !7
         42    >   IS_SMALLER                                               !7, 1000000
         43      > JMPNZ                                                    ~53, ->35
   25    44    >   UNSET_CV                                                 !7
   26    45        INIT_FCALL                                               'microtime'
         46        SEND_VAL                                                 <true>
         47        DO_ICALL                                         $54     
         48        ASSIGN                                                   !13, $54
   27    49        SUB                                              ~56     !13, !11
         50        ASSIGN                                                   !14, ~56
   28    51        ASSIGN_DIM                                               !5, 'Test2'
         52        OP_DATA                                                  !14
   31    53        INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $59     
         56        ASSIGN                                                   !15, $59
   32    57        ASSIGN                                                   !7, 0
         58      > JMP                                                      ->70
   33    59    >   INIT_FCALL                                               'implode'
         60        SEND_VAL                                                 ''
   34    61        INIT_ARRAY                                       ~62     !0
         62        ADD_ARRAY_ELEMENT                                ~62     !1
         63        ADD_ARRAY_ELEMENT                                ~62     !2
         64        ADD_ARRAY_ELEMENT                                ~62     !3
         65        ADD_ARRAY_ELEMENT                                ~62     !4
         66        SEND_VAL                                                 ~62
         67        DO_ICALL                                         $63     
   33    68        ASSIGN                                                   !16, $63
   32    69        PRE_INC                                                  !7
         70    >   IS_SMALLER                                               !7, 1000000
         71      > JMPNZ                                                    ~66, ->59
   37    72    >   UNSET_CV                                                 !7
   38    73        INIT_FCALL                                               'microtime'
         74        SEND_VAL                                                 <true>
         75        DO_ICALL                                         $67     
         76        ASSIGN                                                   !17, $67
   39    77        SUB                                              ~69     !17, !15
         78        ASSIGN                                                   !18, ~69
   40    79        ASSIGN_DIM                                               !5, 'Test3'
         80        OP_DATA                                                  !18
   42    81        INIT_FCALL                                               'microtime'
         82        SEND_VAL                                                 <true>
         83        DO_ICALL                                         $72     
         84        ASSIGN                                                   !19, $72
   43    85        ASSIGN                                                   !7, 0
         86      > JMP                                                      ->97
   44    87    >   INIT_FCALL                                               'sprintf'
         88        SEND_VAL                                                 '%25s%25s%25s%25s%25s'
   45    89        SEND_VAR                                                 !0
         90        SEND_VAR                                                 !1
         91        SEND_VAR                                                 !2
         92        SEND_VAR                                                 !3
         93        SEND_VAR                                                 !4
         94        DO_ICALL                                         $75     
   44    95        ASSIGN                                                   !20, $75
   43    96        PRE_INC                                                  !7
         97    >   IS_SMALLER                                               !7, 1000000
         98      > JMPNZ                                                    ~78, ->87
   48    99    >   UNSET_CV                                                 !7
   49   100        INIT_FCALL                                               'microtime'
        101        SEND_VAL                                                 <true>
        102        DO_ICALL                                         $79     
        103        ASSIGN                                                   !21, $79
   50   104        SUB                                              ~81     !21, !19
        105        ASSIGN                                                   !22, ~81
   51   106        ASSIGN_DIM                                               !5, 'Test4'
        107        OP_DATA                                                  !22
   53   108        INIT_FCALL                                               'sort'
        109        SEND_REF                                                 !5
        110        DO_ICALL                                                 
   55   111        INIT_FCALL                                               'var_dump'
        112        SEND_VAR                                                 !5
        113        DO_ICALL                                                 
        114      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.03 ms | 1404 KiB | 23 Q