3v4l.org

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

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 9
filename:       /in/oTUfr
function name:  x
number of ops:  27
compiled vars:  !0 = $n, !1 = $i, !2 = $factors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ECHO                                                     'Factors%3A+'
    4     2        ASSIGN                                                   !1, 1
          3      > JMP                                                      ->16
    5     4    >   MOD                                              ~4      !0, !1
          5        IS_EQUAL                                         ~5      ~4, 0
          6      > JMPZ_EX                                          ~5      ~5, ->9
          7    >   IS_NOT_EQUAL                                     ~6      !1, !0
          8        BOOL                                             ~5      ~6
          9    > > JMPZ                                                     ~5, ->15
    6    10    >   ASSIGN_DIM                                               !2
         11        OP_DATA                                                  !1
    7    12        NOP                                                      
         13        FAST_CONCAT                                      ~8      !1, '+'
         14        ECHO                                                     ~8
    4    15    >   PRE_INC                                                  !1
         16    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         17      > JMPNZ                                                    ~10, ->4
   10    18    >   INIT_FCALL                                               'array_sum'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $11     
         21        IS_EQUAL                                                 !0, $11
         22      > JMPZ                                                     ~12, ->25
   11    23    >   ECHO                                                     '%5BPerfect%5D'
         24      > JMP                                                      ->26
   14    25    >   ECHO                                                     '%5BImperfect%5D'
   16    26    > > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.07 ms | 1407 KiB | 16 Q