3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 80000; $start = microtime(true); $arr = array(); if ($n >= 2) $arr[] = 2; for ($i = 3; $i<=$n; $i+=2) { $arr[] = $i; } foreach ($arr as $key=>$row) { foreach($arr as $key2=>$row2) { if ($key2 > $key && ($row2 % $row) === 0) { unset($arr[$key2]); } } } $arr = array_values($arr); echo '<pre>'; echo array_sum($arr), PHP_EOL; echo (microtime(true)-$start);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 33
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 33
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 31
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 30
Branch analysis from position: 28
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 31
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 12
Branch analysis from position: 17
Branch analysis from position: 12
Branch analysis from position: 10
filename:       /in/5aQvt
function name:  (null)
number of ops:  50
compiled vars:  !0 = $n, !1 = $start, !2 = $arr, !3 = $i, !4 = $row, !5 = $key, !6 = $row2, !7 = $key2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 80000
    4     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
    6     5        ASSIGN                                                   !2, <array>
    7     6        IS_SMALLER_OR_EQUAL                                      2, !0
          7      > JMPZ                                                     ~12, ->10
          8    >   ASSIGN_DIM                                               !2
          9        OP_DATA                                                  2
    8    10    >   ASSIGN                                                   !3, 3
         11      > JMP                                                      ->15
    9    12    >   ASSIGN_DIM                                               !2
         13        OP_DATA                                                  !3
    8    14        ASSIGN_OP                                     1          !3, 2
         15    >   IS_SMALLER_OR_EQUAL                                      !3, !0
         16      > JMPNZ                                                    ~17, ->12
   12    17    > > FE_RESET_R                                       $18     !2, ->33
         18    > > FE_FETCH_R                                       ~19     $18, !4, ->33
         19    >   ASSIGN                                                   !5, ~19
   13    20      > FE_RESET_R                                       $21     !2, ->31
         21    > > FE_FETCH_R                                       ~22     $21, !6, ->31
         22    >   ASSIGN                                                   !7, ~22
   14    23        IS_SMALLER                                       ~24     !5, !7
         24      > JMPZ_EX                                          ~24     ~24, ->28
         25    >   MOD                                              ~25     !6, !4
         26        IS_IDENTICAL                                     ~26     ~25, 0
         27        BOOL                                             ~24     ~26
         28    > > JMPZ                                                     ~24, ->30
   15    29    >   UNSET_DIM                                                !2, !7
   13    30    > > JMP                                                      ->21
         31    >   FE_FREE                                                  $21
   12    32      > JMP                                                      ->18
         33    >   FE_FREE                                                  $18
   19    34        INIT_FCALL                                               'array_values'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $27     
         37        ASSIGN                                                   !2, $27
   21    38        ECHO                                                     '%3Cpre%3E'
   22    39        INIT_FCALL                                               'array_sum'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                         $29     
         42        ECHO                                                     $29
         43        ECHO                                                     '%0A'
   23    44        INIT_FCALL                                               'microtime'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $30     
         47        SUB                                              ~31     $30, !1
         48        ECHO                                                     ~31
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.76 ms | 1392 KiB | 19 Q