3v4l.org

run code in 300+ PHP versions simultaneously
<?php $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 300000; $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 = 62) Position 1 = -2
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/L5Qsp
function name:  (null)
number of ops:  31
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, 300000
         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
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.78 ms | 1396 KiB | 19 Q