3v4l.org

run code in 300+ PHP versions simultaneously
<?php $shortstring='hello'; $longstring='long'; for($run=0;$run<1000;$run++) $longstring.='dsfsda'.rand(1000,2000); $time=microtime(true); for($run=0;$run<1000;$run++) $temp=strlen($shortstring); $time=microtime(true)-$time; echo "strlen on short string took $time seconds\n"; $time=microtime(true); for($run=0;$run<1000;$run++) $temp2=strlen($longstring); $time=microtime(true)-$time; echo "strlen on long string took $time seconds\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 = 4
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 39
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 39
Branch analysis from position: 44
Branch analysis from position: 39
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 19
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/NQ1Mu
function name:  (null)
number of ops:  54
compiled vars:  !0 = $shortstring, !1 = $longstring, !2 = $run, !3 = $time, !4 = $temp, !5 = $temp2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hello'
    4     1        ASSIGN                                                   !1, 'long'
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->11
    6     4    >   INIT_FCALL                                               'rand'
          5        SEND_VAL                                                 1000
          6        SEND_VAL                                                 2000
          7        DO_ICALL                                         $9      
          8        CONCAT                                           ~10     'dsfsda', $9
          9        ASSIGN_OP                                     8          !1, ~10
    5    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, 1000
         12      > JMPNZ                                                    ~13, ->4
    8    13    >   INIT_FCALL                                               'microtime'
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !3, $14
    9    17        ASSIGN                                                   !2, 0
         18      > JMP                                                      ->22
   10    19    >   STRLEN                                           ~17     !0
         20        ASSIGN                                                   !4, ~17
    9    21        PRE_INC                                                  !2
         22    >   IS_SMALLER                                               !2, 1000
         23      > JMPNZ                                                    ~20, ->19
   11    24    >   INIT_FCALL                                               'microtime'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $21     
         27        SUB                                              ~22     $21, !3
         28        ASSIGN                                                   !3, ~22
   13    29        ROPE_INIT                                     3  ~25     'strlen+on+short+string+took+'
         30        ROPE_ADD                                      1  ~25     ~25, !3
         31        ROPE_END                                      2  ~24     ~25, '+seconds%0A'
         32        ECHO                                                     ~24
   15    33        INIT_FCALL                                               'microtime'
         34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $27     
         36        ASSIGN                                                   !3, $27
   16    37        ASSIGN                                                   !2, 0
         38      > JMP                                                      ->42
   17    39    >   STRLEN                                           ~30     !1
         40        ASSIGN                                                   !5, ~30
   16    41        PRE_INC                                                  !2
         42    >   IS_SMALLER                                               !2, 1000
         43      > JMPNZ                                                    ~33, ->39
   18    44    >   INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $34     
         47        SUB                                              ~35     $34, !3
         48        ASSIGN                                                   !3, ~35
   20    49        ROPE_INIT                                     3  ~38     'strlen+on+long+string+took+'
         50        ROPE_ADD                                      1  ~38     ~38, !3
         51        ROPE_END                                      2  ~37     ~38, '+seconds%0A'
         52        ECHO                                                     ~37
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.84 ms | 1400 KiB | 17 Q