3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($n){for($i=1;$i<=$n;$i++){$n%$i==0&&$i!=$n?$f[]=$i&printf("$i "):0;}echo "$n " . array_sum($f) . " "; printf(array_sum($f)==$n?'P':'I');}x(28);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghT2u
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     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 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
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/ghT2u
function name:  x
number of ops:  44
compiled vars:  !0 = $n, !1 = $i, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->22
          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
         21        PRE_INC                                                  !1
         22    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         23      > JMPNZ                                                    ~13, ->3
         24    >   NOP                                                      
         25        FAST_CONCAT                                      ~14     !0, '+'
         26        INIT_FCALL                                               'array_sum'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                         $15     
         29        CONCAT                                           ~16     ~14, $15
         30        CONCAT                                           ~17     ~16, '+'
         31        ECHO                                                     ~17
         32        INIT_FCALL                                               'printf'
         33        INIT_FCALL                                               'array_sum'
         34        SEND_VAR                                                 !2
         35        DO_ICALL                                         $18     
         36        IS_EQUAL                                                 !0, $18
         37      > JMPZ                                                     ~19, ->40
         38    >   QM_ASSIGN                                        ~20     'P'
         39      > JMP                                                      ->41
         40    >   QM_ASSIGN                                        ~20     'I'
         41    >   SEND_VAL                                                 ~20
         42        DO_ICALL                                                 
         43      > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.38 ms | 1403 KiB | 18 Q