3v4l.org

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