3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($n){ for($i=1;$i<$n;$i++){ $n%$i ? : $f[]=$i; } echo 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/sKtBK
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
Branch analysis from position: 3
filename:       /in/sKtBK
function name:  x
number of ops:  25
compiled vars:  !0 = $n, !1 = $i, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->10
    4     3    >   MOD                                              ~4      !0, !1
          4        JMP_SET                                          ~5      ~4, ->8
          5        ASSIGN_DIM                                       ~6      !2
          6        OP_DATA                                                  !1
          7        QM_ASSIGN                                        ~5      ~6
          8        FREE                                                     ~5
    3     9        PRE_INC                                                  !1
         10    >   IS_SMALLER                                               !1, !0
         11      > JMPNZ                                                    ~8, ->3
    6    12    >   INIT_FCALL                                               'array_sum'
         13        BEGIN_SILENCE                                    ~9      
         14        FETCH_R                      local               ~10     'f'
         15        END_SILENCE                                              ~9
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
         18        IS_EQUAL                                                 !0, $11
         19      > JMPZ                                                     ~12, ->22
         20    >   QM_ASSIGN                                        ~13     'P'
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~13     'I'
         23    >   ECHO                                                     ~13
    7    24      > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.01 ms | 1390 KiB | 16 Q