3v4l.org

run code in 300+ PHP versions simultaneously
<?php $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 30000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ; // standard string append $starttime = microtime(true); $str = ''; for ($i = 0; $i < 30000; $i++) { $str .= 'String concatenation. ' . $i; } $x = md5($str); unset($str); $endtime = microtime(true); print "string concat: " . ($endtime - $starttime) . " s\n" ; $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 30000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 37
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 62
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 62
Branch analysis from position: 68
Branch analysis from position: 62
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 37
Branch analysis from position: 42
Branch analysis from position: 37
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/9retJ
function name:  (null)
number of ops:  86
compiled vars:  !0 = $starttime, !1 = $sArr, !2 = $i, !3 = $str, !4 = $x, !5 = $endtime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    3     4        ASSIGN                                                   !1, <array>
    4     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->11
    5     7    >   CONCAT                                           ~11     'String+concatenation.+', !2
          8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  ~11
    4    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, 30000
         12      > JMPNZ                                                    ~13, ->7
    7    13    >   INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !3, $14
    8    18        INIT_FCALL                                               'md5'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $16     
         21        ASSIGN                                                   !4, $16
    9    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $18     
         25        ASSIGN                                                   !5, $18
   10    26        SUB                                              ~20     !5, !0
         27        CONCAT                                           ~21     'array+append+%26+implode%3A+', ~20
         28        CONCAT                                           ~22     ~21, '+s%0A'
         29        ECHO                                                     ~22
   13    30        INIT_FCALL                                               'microtime'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $23     
         33        ASSIGN                                                   !0, $23
   14    34        ASSIGN                                                   !3, ''
   15    35        ASSIGN                                                   !2, 0
         36      > JMP                                                      ->40
   16    37    >   CONCAT                                           ~27     'String+concatenation.+', !2
         38        ASSIGN_OP                                     8          !3, ~27
   15    39        PRE_INC                                                  !2
         40    >   IS_SMALLER                                               !2, 30000
         41      > JMPNZ                                                    ~30, ->37
   18    42    >   INIT_FCALL                                               'md5'
         43        SEND_VAR                                                 !3
         44        DO_ICALL                                         $31     
         45        ASSIGN                                                   !4, $31
   19    46        UNSET_CV                                                 !3
   20    47        INIT_FCALL                                               'microtime'
         48        SEND_VAL                                                 <true>
         49        DO_ICALL                                         $33     
         50        ASSIGN                                                   !5, $33
   21    51        SUB                                              ~35     !5, !0
         52        CONCAT                                           ~36     'string+concat%3A+', ~35
         53        CONCAT                                           ~37     ~36, '+s%0A'
         54        ECHO                                                     ~37
   23    55        INIT_FCALL                                               'microtime'
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $38     
         58        ASSIGN                                                   !0, $38
   24    59        ASSIGN                                                   !1, <array>
   25    60        ASSIGN                                                   !2, 0
         61      > JMP                                                      ->66
   26    62    >   CONCAT                                           ~43     'String+concatenation.+', !2
         63        ASSIGN_DIM                                               !1
         64        OP_DATA                                                  ~43
   25    65        PRE_INC                                                  !2
         66    >   IS_SMALLER                                               !2, 30000
         67      > JMPNZ                                                    ~45, ->62
   28    68    >   INIT_FCALL                                               'implode'
         69        SEND_VAL                                                 ''
         70        SEND_VAR                                                 !1
         71        DO_ICALL                                         $46     
         72        ASSIGN                                                   !3, $46
   29    73        INIT_FCALL                                               'md5'
         74        SEND_VAR                                                 !3
         75        DO_ICALL                                         $48     
         76        ASSIGN                                                   !4, $48
   30    77        INIT_FCALL                                               'microtime'
         78        SEND_VAL                                                 <true>
         79        DO_ICALL                                         $50     
         80        ASSIGN                                                   !5, $50
   31    81        SUB                                              ~52     !5, !0
         82        CONCAT                                           ~53     'array+append+%26+implode%3A+', ~52
         83        CONCAT                                           ~54     ~53, '+s%0A'
         84        ECHO                                                     ~54
         85      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.86 ms | 1404 KiB | 19 Q