3v4l.org

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

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.47 ms | 1403 KiB | 16 Q