3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayOfDivisors($x) { $divisors = array (); for($i = 1; $i < $x; $i ++) { if ($x % $i == 0) { if($i>$x/$i){break;} } } return [$i,$x/$i]; } var_dump (arrayOfDivisors ( 20 ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oJf8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'arrayofdivisors'
          2        SEND_VAL                                                 20
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function arrayofdivisors:
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
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
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: 11
filename:       /in/1oJf8
function name:  arrayOfDivisors
number of ops:  19
compiled vars:  !0 = $x, !1 = $divisors, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->12
    5     4    >   MOD                                              ~5      !0, !2
          5        IS_EQUAL                                                 ~5, 0
          6      > JMPZ                                                     ~6, ->11
    6     7    >   DIV                                              ~7      !0, !2
          8        IS_SMALLER                                               ~7, !2
          9      > JMPZ                                                     ~8, ->11
         10    > > JMP                                                      ->14
    4    11    >   PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, !0
         13      > JMPNZ                                                    ~10, ->4
    9    14    >   INIT_ARRAY                                       ~11     !2
         15        DIV                                              ~12     !0, !2
         16        ADD_ARRAY_ELEMENT                                ~11     ~12
         17      > RETURN                                                   ~11
   10    18*     > RETURN                                                   null

End of function arrayofdivisors

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.87 ms | 1399 KiB | 16 Q