3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f1_virgule() { $a = ''; for($i=0; $i<100000; ++$i) { echo $a,$i,"\n"; } } function f2_point() { $a = ''; for($i=0; $i<100000; ++$i) { echo $a.$i."\n"; } } $start = microtime(true); f2_point(); $stop = microtime(true); $time_point = $stop - $start; $start = microtime(true); f1_virgule(); $stop = microtime(true); $time_virgule = $stop - $start; echo 'time virgule : ' . $time_virgule . "\n"; echo 'time point : ' . $time_point . "\n"; echo 'time virgule > time time_point => ' . ($time_virgule > $time_point); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e7Go5
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $stop, !2 = $time_point, !3 = $time_virgule
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   16     4        INIT_FCALL                                               'f2_point'
          5        DO_FCALL                                      0          
   17     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !1, $7
   18    10        SUB                                              ~9      !1, !0
         11        ASSIGN                                                   !2, ~9
   20    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !0, $11
   21    16        INIT_FCALL                                               'f1_virgule'
         17        DO_FCALL                                      0          
   22    18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !1, $14
   23    22        SUB                                              ~16     !1, !0
         23        ASSIGN                                                   !3, ~16
   25    24        CONCAT                                           ~18     'time+virgule+%3A+', !3
         25        CONCAT                                           ~19     ~18, '%0A'
         26        ECHO                                                     ~19
   26    27        CONCAT                                           ~20     'time+point+++%3A+', !2
         28        CONCAT                                           ~21     ~20, '%0A'
         29        ECHO                                                     ~21
   27    30        IS_SMALLER                                       ~22     !2, !3
         31        CONCAT                                           ~23     'time+virgule+%3E+time+time_point+%3D%3E+', ~22
         32        ECHO                                                     ~23
   28    33      > RETURN                                                   1

Function f1_virgule:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/e7Go5
function name:  f1_virgule
number of ops:  10
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
    5     3    >   ECHO                                                     !0
          4        ECHO                                                     !1
          5        ECHO                                                     '%0A'
    4     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 100000
          8      > JMPNZ                                                    ~5, ->3
    7     9    > > RETURN                                                   null

End of function f1_virgule

Function f2_point:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/e7Go5
function name:  f2_point
number of ops:  10
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, ''
   10     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
   11     3    >   CONCAT                                           ~4      !0, !1
          4        CONCAT                                           ~5      ~4, '%0A'
          5        ECHO                                                     ~5
   10     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 100000
          8      > JMPNZ                                                    ~7, ->3
   13     9    > > RETURN                                                   null

End of function f2_point

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.72 ms | 1402 KiB | 17 Q