3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array_fill(0, 1000, 'xxxxx'); $runs = 100; $first = 0.0; $second = 0.0; for ($i = 0; $i < $runs; $i++) { $start = microtime(true); foreach ($arr as $value) { strpos('xxxxxxx', $value); } $end = microtime(true); $first += ($end-$start); } print "First: " . ($first/$runs) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 11
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 11
Branch analysis from position: 33
Branch analysis from position: 11
Branch analysis from position: 22
filename:       /in/jq4Xq
function name:  (null)
number of ops:  38
compiled vars:  !0 = $arr, !1 = $runs, !2 = $first, !3 = $second, !4 = $i, !5 = $start, !6 = $value, !7 = $end
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL                                               'array_fill'
         1        SEND_VAL                                                 0
         2        SEND_VAL                                                 1000
         3        SEND_VAL                                                 'xxxxx'
         4        DO_ICALL                                         $8      
         5        QM_ASSIGN                                                !0
   5     6        QM_ASSIGN                                                !1
   7     7        QM_ASSIGN                                                !2
   8     8        QM_ASSIGN                                                !3
   9     9        QM_ASSIGN                                                !4
        10      > JMP                                                      ->31
  11    11    >   INIT_FCALL                                               'microtime'
        12        SEND_VAL                                                 <true>
        13        DO_ICALL                                         $14     
        14        QM_ASSIGN                                                !5
  12    15      > FE_RESET_R                                       $16     !0, ->22
        16    > > FE_FETCH_R                                               $16, !6, ->22
  13    17    >   INIT_FCALL                                               'strpos'
        18        SEND_VAL                                                 'xxxxxxx'
        19        SEND_VAR                                                 !6
        20        DO_ICALL                                                 
  12    21      > JMP                                                      ->16
        22    >   FE_FREE                                                  $16
  15    23        INIT_FCALL                                               'microtime'
        24        SEND_VAL                                                 <true>
        25        DO_ICALL                                         $18     
        26        QM_ASSIGN                                                !7
  16    27        SUB                                              ~20     !7, !5
        28        ASSIGN_DIV                                    1          !2, ~20
   9    29        POST_INC                                         ~22     !4
        30        FREE                                                     ~22
        31    >   IS_SMALLER_OR_EQUAL                              ~23     !4, !1
        32      > JMPNZ                                                    ~23, ->11
  19    33    >   DIV                                              ~24     !2, !1
        34        CONCAT                                           ~25     'First%3A++', ~24
        35        CONCAT                                           ~26     ~25, '%0A'
        36        ASSIGN_OBJ                                               ~26
        37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
12.37 ms | 466 KiB | 7 Q