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/RVpDU
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 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
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/RVpDU
function name:  x
number of ops:  22
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        SEND_VAR                                                 !2
         14        DO_ICALL                                         $9      
         15        IS_EQUAL                                                 !0, $9
         16      > JMPZ                                                     ~10, ->19
         17    >   QM_ASSIGN                                        ~11     'P'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~11     'I'
         20    >   ECHO                                                     ~11
    7    21      > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.85 ms | 1390 KiB | 16 Q