3v4l.org

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

End of function x

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
204.56 ms | 1394 KiB | 18 Q