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 & $i!=$n : 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/6D9vu
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 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
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 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
Branch analysis from position: 3
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
Branch analysis from position: 3
Branch analysis from position: 8
filename:       /in/6D9vu
function name:  x
number of ops:  36
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                                                      ->18
    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, ->15
          9    >   IS_NOT_EQUAL                                     ~8      !1, !0
         10        BW_AND                                           ~9      !1, ~8
         11        ASSIGN_DIM                                       ~7      !2
         12        OP_DATA                                                  ~9
         13        QM_ASSIGN                                        ~10     ~7
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~10     0
         16    >   FREE                                                     ~10
    3    17        PRE_INC                                                  !1
         18    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         19      > JMPNZ                                                    ~12, ->3
    6    20    >   INIT_FCALL                                               'array_sum'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $13     
         23        IS_EQUAL                                                 !0, $13
         24      > JMPZ                                                     ~14, ->30
         25    >   INIT_FCALL                                               'printf'
         26        SEND_VAL                                                 'P'
         27        DO_ICALL                                         $15     
         28        QM_ASSIGN                                        ~16     $15
         29      > JMP                                                      ->34
         30    >   INIT_FCALL                                               'printf'
         31        SEND_VAL                                                 'I'
         32        DO_ICALL                                         $17     
         33        QM_ASSIGN                                        ~16     $17
         34    >   FREE                                                     ~16
    7    35      > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.24 ms | 1403 KiB | 18 Q