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); $second += ($end-$start); } print "Second: " . ($second/$runs) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 11
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 125) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 126) 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 = 32, Position 2 = 11
Branch analysis from position: 32
Branch analysis from position: 11
Branch analysis from position: 22
filename:       /in/ENFVo
function name:  (null)
number of ops:  37
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        ASSIGN                                                   !0, $8
    5     6        ASSIGN                                                   !1, 100
    7     7        ASSIGN                                                   !2, 0
    8     8        ASSIGN                                                   !3, 0
    9     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->30
   10    11    >   INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !5, $14
   11    15      > FE_RESET_RW                                      $16     !0, ->22
         16    > > FE_FETCH_RW                                              $16, !6, ->22
   12    17    >   INIT_FCALL                                               'strpos'
         18        SEND_VAL                                                 'xxxxxxx'
         19        SEND_VAR                                                 !6
         20        DO_ICALL                                                 
   11    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $16
   14    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $18     
         26        ASSIGN                                                   !7, $18
   15    27        SUB                                              ~20     !7, !5
         28        ASSIGN_OP                                     1          !3, ~20
    9    29        PRE_INC                                                  !4
         30    >   IS_SMALLER                                               !4, !1
         31      > JMPNZ                                                    ~23, ->11
   18    32    >   DIV                                              ~24     !3, !1
         33        CONCAT                                           ~25     'Second%3A+', ~24
         34        CONCAT                                           ~26     ~25, '%0A'
         35        ECHO                                                     ~26
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.33 ms | 1400 KiB | 19 Q