3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timeStart = microtime(true); $rand = substr(str_shuffle('a-Z strings'), 5, 5); $timeEnd = microtime(true); $time = $timeEnd - $timeStart; echo "Code 1: $time seconds\n"; $timeStart = microtime(true); for ($i = 0; $i <= 5; ++$i) { $rand .= chr(rand(99, 155)); } $timeEnd = microtime(true); $time = $timeEnd - $timeStart; echo "Code 2: $time seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
Branch analysis from position: 29
filename:       /in/lgjps
function name:  (null)
number of ops:  51
compiled vars:  !0 = $timeStart, !1 = $rand, !2 = $timeEnd, !3 = $time, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        INIT_FCALL                                               'substr'
          5        INIT_FCALL                                               'str_shuffle'
          6        SEND_VAL                                                 'a-Z+strings'
          7        DO_ICALL                                         $7      
          8        SEND_VAR                                                 $7
          9        SEND_VAL                                                 5
         10        SEND_VAL                                                 5
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !1, $8
    7    13        INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !2, $10
    8    17        SUB                                              ~12     !2, !0
         18        ASSIGN                                                   !3, ~12
   10    19        ROPE_INIT                                     3  ~15     'Code+1%3A+'
         20        ROPE_ADD                                      1  ~15     ~15, !3
         21        ROPE_END                                      2  ~14     ~15, '+seconds%0A'
         22        ECHO                                                     ~14
   12    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !0, $17
   14    27        ASSIGN                                                   !4, 0
         28      > JMP                                                      ->38
   15    29    >   INIT_FCALL                                               'chr'
         30        INIT_FCALL                                               'rand'
         31        SEND_VAL                                                 99
         32        SEND_VAL                                                 155
         33        DO_ICALL                                         $20     
         34        SEND_VAR                                                 $20
         35        DO_ICALL                                         $21     
         36        ASSIGN_OP                                     8          !1, $21
   14    37        PRE_INC                                                  !4
         38    >   IS_SMALLER_OR_EQUAL                                      !4, 5
         39      > JMPNZ                                                    ~24, ->29
   18    40    >   INIT_FCALL                                               'microtime'
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $25     
         43        ASSIGN                                                   !2, $25
   19    44        SUB                                              ~27     !2, !0
         45        ASSIGN                                                   !3, ~27
   21    46        ROPE_INIT                                     3  ~30     'Code+2%3A+'
         47        ROPE_ADD                                      1  ~30     ~30, !3
         48        ROPE_END                                      2  ~29     ~30, '+seconds%0A'
         49        ECHO                                                     ~29
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.8 ms | 1469 KiB | 18 Q