3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nums = \range(0, 25000); $starts = []; $ends = []; for ($i = 0; $i < 10; ++$i) { $starts[] = \microtime(true); $fout = []; foreach ($nums as $item) { $fout[] = (string)$item . 'f'; } $ends[] = \microtime(true); } $total = 0; for ($i = 0; $i < 10; ++$i) { $total += $ends[$i] * 1000 - $starts[$i] * 1000; } \var_dump(\round($total / 10, 2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 34
Branch analysis from position: 43
Branch analysis from position: 34
Branch analysis from position: 9
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 = 31, Position 2 = 9
Branch analysis from position: 31
Branch analysis from position: 9
Branch analysis from position: 22
filename:       /in/8QMFh
function name:  (null)
number of ops:  52
compiled vars:  !0 = $nums, !1 = $starts, !2 = $ends, !3 = $i, !4 = $fout, !5 = $item, !6 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 25000
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
    5     5        ASSIGN                                                   !1, <array>
    6     6        ASSIGN                                                   !2, <array>
    7     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->29
    8     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $13     
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $13
    9    14        ASSIGN                                                   !4, <array>
   10    15      > FE_RESET_R                                       $15     !0, ->22
         16    > > FE_FETCH_R                                               $15, !5, ->22
   11    17    >   CAST                                          6  ~17     !5
         18        CONCAT                                           ~18     ~17, 'f'
         19        ASSIGN_DIM                                               !4
         20        OP_DATA                                                  ~18
   10    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $15
   13    23        INIT_FCALL                                               'microtime'
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $20     
         26        ASSIGN_DIM                                               !2
         27        OP_DATA                                                  $20
    7    28        PRE_INC                                                  !3
         29    >   IS_SMALLER                                               !3, 10
         30      > JMPNZ                                                    ~22, ->9
   16    31    >   ASSIGN                                                   !6, 0
   17    32        ASSIGN                                                   !3, 0
         33      > JMP                                                      ->41
   18    34    >   FETCH_DIM_R                                      ~25     !2, !3
         35        MUL                                              ~26     ~25, 1000
         36        FETCH_DIM_R                                      ~27     !1, !3
         37        MUL                                              ~28     ~27, 1000
         38        SUB                                              ~29     ~26, ~28
         39        ASSIGN_OP                                     1          !6, ~29
   17    40        PRE_INC                                                  !3
         41    >   IS_SMALLER                                               !3, 10
         42      > JMPNZ                                                    ~32, ->34
   20    43    >   INIT_FCALL                                               'var_dump'
         44        INIT_FCALL                                               'round'
         45        DIV                                              ~33     !6, 10
         46        SEND_VAL                                                 ~33
         47        SEND_VAL                                                 2
         48        DO_ICALL                                         $34     
         49        SEND_VAR                                                 $34
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.53 ms | 1400 KiB | 21 Q