3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PrimeFactors { public static function generate($n) { $primes = array(); for ($candidate =2; $n > 1; $candidate++) { for (;0 === $n % $candidate;$n /= $candidate) { $primes[] = $candidate; } } return $primes; } } echo PrimeFactors::generate(1989);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z38Xf
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'PrimeFactors', 'generate'
          1        SEND_VAL                                                 1989
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Class PrimeFactors:
Function generate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 4
Branch analysis from position: 14
Branch analysis from position: 4
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/Z38Xf
function name:  generate
number of ops:  16
compiled vars:  !0 = $n, !1 = $primes, !2 = $candidate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
    8     2        ASSIGN                                                   !2, 2
          3      > JMP                                                      ->12
    9     4    > > JMP                                                      ->8
   10     5    >   ASSIGN_DIM                                               !1
          6        OP_DATA                                                  !2
    9     7        ASSIGN_OP                                     4          !0, !2
          8    >   MOD                                              ~7      !0, !2
          9        IS_IDENTICAL                                             ~7, 0
         10      > JMPNZ                                                    ~8, ->5
    8    11    >   PRE_INC                                                  !2
         12    >   IS_SMALLER                                               1, !0
         13      > JMPNZ                                                    ~10, ->4
   13    14    > > RETURN                                                   !1
   14    15*     > RETURN                                                   null

End of function generate

End of class PrimeFactors.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.56 ms | 1395 KiB | 13 Q