3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function x($n) { echo "$n'sFactors: "; 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
Jump found. Position 1 = -2
filename:       /in/NvERI
function name:  (null)
number of ops:  5
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  18     1        INIT_FCALL                                               'x'
         2        SEND_VAL                                                 28
         3        DO_FCALL                                      0          
         4      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 19
Branch analysis from position: 19
Jump found. Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
Jump found. Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Jump found. Position 1 = 29
Branch analysis from position: 29
Jump found. Position 1 = -2
Branch analysis from position: 28
Jump found. Position 1 = -2
Branch analysis from position: 6
Jump found. Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Jump found. Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
Jump found. Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
Branch analysis from position: 6
Branch analysis from position: 17
Branch analysis from position: 11
filename:       /in/NvERI
function name:  x
number of ops:  30
compiled vars:  !0 = $n, !1 = $i, !2 = $factors
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   RECV                                             !0      
   3     1        NOP                                                      
         2        FAST_CONCAT                                      ~3      !0, '%27sFactors%3A+'
         3        ECHO                                                     ~3
   4     4        ASSIGN                                                   !1, 1
         5      > JMP                                                      ->19
   5     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
   6    12    >   ASSIGN_DIM                                               !2
        13        OP_DATA                                                  !1
   7    14        NOP                                                      
        15        FAST_CONCAT                                      ~9      !1, '+'
        16        ECHO                                                     ~9
   4    17    >   POST_INC                                         ~10     !1
        18        FREE                                                     ~10
        19    >   IS_SMALLER_OR_EQUAL                              ~11     !1, !0
        20      > JMPNZ                                                    ~11, ->6
  10    21    >   INIT_FCALL                                               'array_sum'
        22        SEND_VAR                                                 !2
        23        DO_ICALL                                         $12     
        24        IS_EQUAL                                         ~13     !0, $12
        25      > JMPZ                                                     ~13, ->28
  11    26    >   ECHO                                                     '%5BPerfect%5D'
        27      > JMP                                                      ->29
  14    28    >   ECHO                                                     '%5BImperfect%5D'
  16    29    > > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 7.2.0