3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 = 20; $i <= $max; $i++) { if (sp($i) == $i) { echo $i."\n"; } }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 13
Branch analysis from position: 13
Jump found. Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
Jump found. Position 1 = -2
Branch analysis from position: 4
Jump found. Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Jump found. Position 1 = 15, Position 2 = 4
Branch analysis from position: 15
Branch analysis from position: 4
Branch analysis from position: 11
filename:       /in/0kbJ7
function name:  (null)
number of ops:  16
compiled vars:  !0 = $i, !1 = $max
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  15     1        ASSIGN                                                   !0, 1
         2        ASSIGN                                                   !1, 20
         3      > JMP                                                      ->13
  16     4    >   INIT_FCALL                                               'sp'
         5        SEND_VAR                                                 !0
         6        DO_FCALL                                      0  $4      
         7        IS_EQUAL                                         ~5      $4, !0
         8      > JMPZ                                                     ~5, ->11
  17     9    >   CONCAT                                           ~6      !0, '%0A'
        10        ECHO                                                     ~6
  15    11    >   POST_INC                                         ~7      !0
        12        FREE                                                     ~7
        13    >   IS_SMALLER_OR_EQUAL                              ~8      !0, !1
        14      > JMPNZ                                                    ~8, ->4
        15    > > RETURN                                                   1

Function sp:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9
Branch analysis from position: 9
Jump found. Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Jump found. Position 1 = -2
Branch analysis from position: 4
Jump found. Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
Jump found. Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Branch analysis from position: 4
Branch analysis from position: 8
filename:       /in/0kbJ7
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                                         ~6      ~5, 0
         6      > JMPZ                                                     ~6, ->8
   8     7    >   ASSIGN_ADD                                    0          !2, !1
  10     8    >   ASSIGN_ADD                                    0          !1, 1
   6     9    >   IS_SMALLER                                       ~9      !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 7.3.0