3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { function generatePrimes($n) { $this->primes = [2]; for ($i = 3; $i < $n; $i += 2) { foreach ($this->primes as $prime) { if ($i % $prime == 0) continue 2; } $this->primes[] = $i; } } } $c = new C(); $c->generatePrimes(100000);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KI9ZC
function name:  (null)
number of ops:  7
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'generatePrimes'
          4        SEND_VAL_EX                                              100000
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class C:
Function generateprimes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
Branch analysis from position: 5
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
Branch analysis from position: 5
Branch analysis from position: 14
filename:       /in/KI9ZC
function name:  generatePrimes
number of ops:  22
compiled vars:  !0 = $n, !1 = $i, !2 = $prime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'primes'
          2        OP_DATA                                                  <array>
    7     3        ASSIGN                                                   !1, 3
          4      > JMP                                                      ->19
    8     5    >   FETCH_OBJ_R                                      ~5      'primes'
          6      > FE_RESET_R                                       $6      ~5, ->14
          7    > > FE_FETCH_R                                               $6, !2, ->14
    9     8    >   MOD                                              ~7      !1, !2
          9        IS_EQUAL                                                 ~7, 0
         10      > JMPZ                                                     ~8, ->13
   10    11    >   FE_FREE                                                  $6
         12      > JMP                                                      ->18
    8    13    > > JMP                                                      ->7
         14    >   FE_FREE                                                  $6
   12    15        FETCH_OBJ_W                                      $9      'primes'
         16        ASSIGN_DIM                                               $9
         17        OP_DATA                                                  !1
    7    18    >   ASSIGN_OP                                     1          !1, 2
         19    >   IS_SMALLER                                               !1, !0
         20      > JMPNZ                                                    ~12, ->5
   14    21    > > RETURN                                                   null

End of function generateprimes

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.9 ms | 1399 KiB | 13 Q