3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $n = 0; for($i=0;$i<=100;$i+=2) { $n+=$i; } echo $n; $i = 0; $num = 0; while($i <= 50) { $num += $i * 2; $i ++; } echo $num;
based on kGUbf
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 5
Branch analysis from position: 5
Jump found. Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
Jump found. Position 1 = 15
Branch analysis from position: 15
Jump found. Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Jump found. Position 1 = -2
Branch analysis from position: 11
Jump found. Position 1 = 17, Position 2 = 11
Branch analysis from position: 17
Branch analysis from position: 11
Branch analysis from position: 3
Jump found. Position 1 = 7, Position 2 = 3
Branch analysis from position: 7
Branch analysis from position: 3
filename:       /in/81ULt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $n, !1 = $i, !2 = $num
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, 0
   3     1        ASSIGN                                                   !1, 0
         2      > JMP                                                      ->5
   4     3    >   ASSIGN_ADD                                    0          !0, !1
   3     4        ASSIGN_ADD                                    0          !1, 2
         5    >   IS_SMALLER_OR_EQUAL                              ~7      !1, 100
         6      > JMPNZ                                                    ~7, ->3
   6     7    >   ECHO                                                     !0
   8     8        ASSIGN                                                   !1, 0
   9     9        ASSIGN                                                   !2, 0
  10    10      > JMP                                                      ->15
  11    11    >   MUL                                              ~10     !1, 2
        12        ASSIGN_ADD                                    0          !2, ~10
  12    13        POST_INC                                         ~12     !1
        14        FREE                                                     ~12
  10    15    >   IS_SMALLER_OR_EQUAL                              ~13     !1, 50
        16      > JMPNZ                                                    ~13, ->11
  14    17    >   ECHO                                                     !2
        18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0