3v4l.org

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

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.41 ms | 1407 KiB | 16 Q