3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sp($a) { $b = 1; $suma = 0; while ($b < $a) { if ($a % $b == 0) { $suma += $b; } $b += 1; } return $suma; } for ($i = 1, $max = 20000; $i <= $max; $i++) { if (sp($i) == $i) { echo $i."\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
Branch analysis from position: 10
filename:       /in/R2TJi
function name:  (null)
number of ops:  14
compiled vars:  !0 = $i, !1 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 1
          1        ASSIGN                                                   !1, 20000
          2      > JMP                                                      ->11
   16     3    >   INIT_FCALL                                               'sp'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        IS_EQUAL                                                 !0, $4
          7      > JMPZ                                                     ~5, ->10
   17     8    >   CONCAT                                           ~6      !0, '%0A'
          9        ECHO                                                     ~6
   15    10    >   PRE_INC                                                  !0
         11    >   IS_SMALLER_OR_EQUAL                                      !0, !1
         12      > JMPNZ                                                    ~8, ->3
   19    13    > > RETURN                                                   1

Function sp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Branch analysis from position: 4
Branch analysis from position: 8
filename:       /in/R2TJi
function name:  sp
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $suma
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 0
    6     3      > JMP                                                      ->9
    7     4    >   MOD                                              ~5      !0, !1
          5        IS_EQUAL                                                 ~5, 0
          6      > JMPZ                                                     ~6, ->8
    8     7    >   ASSIGN_OP                                     1          !2, !1
   10     8    >   ASSIGN_OP                                     1          !1, 1
    6     9    >   IS_SMALLER                                               !1, !0
         10      > JMPNZ                                                    ~9, ->4
   12    11    > > RETURN                                                   !2
   13    12*     > RETURN                                                   null

End of function sp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.85 ms | 1398 KiB | 14 Q