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 "; } elseif ($i == $n) { echo "\n"; } } if ($n == array_sum($factors)) { echo "It's perfect!"; } else { echo "It's not perfect!"; } } x(28); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S6rXt
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'x'
          1        SEND_VAL                                                 28
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
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 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
Branch analysis from position: 4
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 4
Branch analysis from position: 22
Branch analysis from position: 4
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/S6rXt
function name:  x
number of ops:  31
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                                                      ->20
    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, ->16
    6    10    >   ASSIGN_DIM                                               !2
         11        OP_DATA                                                  !1
    7    12        NOP                                                      
         13        FAST_CONCAT                                      ~8      !1, '+'
         14        ECHO                                                     ~8
         15      > JMP                                                      ->19
    9    16    >   IS_EQUAL                                                 !1, !0
         17      > JMPZ                                                     ~9, ->19
   10    18    >   ECHO                                                     '%0A'
    4    19    >   PRE_INC                                                  !1
         20    >   IS_SMALLER_OR_EQUAL                                      !1, !0
         21      > JMPNZ                                                    ~11, ->4
   13    22    >   INIT_FCALL                                               'array_sum'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $12     
         25        IS_EQUAL                                                 !0, $12
         26      > JMPZ                                                     ~13, ->29
   14    27    >   ECHO                                                     'It%27s+perfect%21'
         28      > JMP                                                      ->30
   17    29    >   ECHO                                                     'It%27s+not+perfect%21'
   19    30    > > RETURN                                                   null

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.52 ms | 1403 KiB | 16 Q