3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($n) { for($i = 1; $i <= $n; $i++) { $n % $i == 0 && $i != $n ? $factors[]=$i & printf("$i ") : 0; } array_sum($factors) == $n ? printf('P') : printf('I'); } x(28);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4SZFi
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'x'
          1        SEND_VAL                                                 28
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 3
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 34
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 3
Branch analysis from position: 24
Branch analysis from position: 3
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 3
Branch analysis from position: 24
Branch analysis from position: 3
Branch analysis from position: 8
filename:       /in/4SZFi
function name:  x
number of ops:  40
compiled vars:  !0 = $n, !1 = $i, !2 = $factors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->22
    4     3    >   MOD                                              ~4      !0, !1
          4        IS_EQUAL                                         ~5      ~4, 0
          5      > JMPZ_EX                                          ~5      ~5, ->8
          6    >   IS_NOT_EQUAL                                     ~6      !1, !0
          7        BOOL                                             ~5      ~6
          8    > > JMPZ                                                     ~5, ->19
          9    >   INIT_FCALL                                               'printf'
         10        NOP                                                      
         11        FAST_CONCAT                                      ~8      !1, '+'
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        BW_AND                                           ~10     !1, $9
         15        ASSIGN_DIM                                       ~7      !2
         16        OP_DATA                                                  ~10
         17        QM_ASSIGN                                        ~11     ~7
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~11     0
         20    >   FREE                                                     ~11
    3    21        PRE_INC                                                  !1
         22    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         23      > JMPNZ                                                    ~13, ->3
    6    24    >   INIT_FCALL                                               'array_sum'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $14     
         27        IS_EQUAL                                                 !0, $14
         28      > JMPZ                                                     ~15, ->34
         29    >   INIT_FCALL                                               'printf'
         30        SEND_VAL                                                 'P'
         31        DO_ICALL                                         $16     
         32        QM_ASSIGN                                        ~17     $16
         33      > JMP                                                      ->38
         34    >   INIT_FCALL                                               'printf'
         35        SEND_VAL                                                 'I'
         36        DO_ICALL                                         $18     
         37        QM_ASSIGN                                        ~17     $18
         38    >   FREE                                                     ~17
    7    39      > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.46 ms | 1403 KiB | 18 Q