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

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.26 ms | 1403 KiB | 16 Q