3v4l.org

run code in 300+ PHP versions simultaneously
$<?php function iprimes_upto($limit){ for ($i = 2; $i < $limit; $i++){ $primes[$i] = true; } for ($n = 2; $n < $limit; $n++){ if ($primes[$n]){ for ($i = $n*$n; $i < $limit; $i += $n){ $primes[$i] = false; } } } return $primes; } iprimes_upto(10000000); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e8n4u
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%24'
   15     1        INIT_FCALL                                               'iprimes_upto'
          2        SEND_VAL                                                 10000000
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   1

Function iprimes_upto:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 10
Branch analysis from position: 23
Branch analysis from position: 10
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 15
Branch analysis from position: 20
Branch analysis from position: 15
Branch analysis from position: 20
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/e8n4u
function name:  iprimes_upto
number of ops:  25
compiled vars:  !0 = $limit, !1 = $i, !2 = $primes, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 2
          2      > JMP                                                      ->6
    4     3    >   ASSIGN_DIM                                               !2, !1
          4        OP_DATA                                                  <true>
    3     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, !0
          7      > JMPNZ                                                    ~7, ->3
    6     8    >   ASSIGN                                                   !3, 2
          9      > JMP                                                      ->21
    7    10    >   FETCH_DIM_R                                      ~9      !2, !3
         11      > JMPZ                                                     ~9, ->20
    8    12    >   MUL                                              ~10     !3, !3
         13        ASSIGN                                                   !1, ~10
         14      > JMP                                                      ->18
    9    15    >   ASSIGN_DIM                                               !2, !1
         16        OP_DATA                                                  <false>
    8    17        ASSIGN_OP                                     1          !1, !3
         18    >   IS_SMALLER                                               !1, !0
         19      > JMPNZ                                                    ~14, ->15
    6    20    >   PRE_INC                                                  !3
         21    >   IS_SMALLER                                               !3, !0
         22      > JMPNZ                                                    ~16, ->10
   13    23    > > RETURN                                                   !2
   14    24*     > RETURN                                                   null

End of function iprimes_upto

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1403 KiB | 14 Q