3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <head> <title>Online PHP Script Execution</title> </head> <body> <form method="get" action=""> Enter the First Number <input type="text" name="number1"> Enter the Second Number <input type="text" name="number2"> Choose the operation <input type="radio" name="op" value="add" checked> Addition <input type="radio" name="op" value="sub"> Subtraction <input type="radio" name="op" value="mul"> Multiplication <input type="radio" name="op" value="div"> Division <input type="submit" name="Submit" value="Submit"> </form> <?php if ( $op == "add" ) { echo "$number1 + $number2 = "; echo $number1 + $number2; } if ( $op == "sub" ) { echo "$number1 - $number2 = "; echo $number1 - $number2; } if ( $op == "mul" ) { echo "$number1 * $number2 = "; echo $number1 * $number2; } if ( $op == "div" ) { echo "$number1 / $number2 = "; echo $number1 / $number2; } ?> </body> </html>
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
Jump found. Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
Jump found. Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
Jump found. Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
Jump found. Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 28
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/nQNIn
function name:  (null)
number of ops:  39
compiled vars:  !0 = $op, !1 = $number1, !2 = $number2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  25     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3EOnline+PHP+Script+Execution%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Cform+method%3D%22get%22+action%3D%22%22%3E%0A%0AEnter+the+First+Number+%3Cinput+type%3D%22text%22+name%3D%22number1%22%3E%0A%0AEnter+the+Second+Number+%3Cinput+type%3D%22text%22+name%3D%22number2%22%3E%0A%0AChoose+the+operation%0A%3Cinput+type%3D%22radio%22+name%3D%22op%22+value%3D%22add%22+checked%3E%0A%0AAddition+%3Cinput+type%3D%22radio%22+name%3D%22op%22+value%3D%22sub%22%3E%0A%0ASubtraction+%3Cinput+type%3D%22radio%22+name%3D%22op%22+value%3D%22mul%22%3E%0A%0AMultiplication+%3Cinput+type%3D%22radio%22+name%3D%22op%22+value%3D%22div%22%3E%0A%0ADivision+%3Cinput+type%3D%22submit%22+name%3D%22Submit%22+value%3D%22Submit%22%3E%0A%0A%3C%2Fform%3E%0A%0A'
  27     1        IS_EQUAL                                         ~3      !0, 'add'
         2      > JMPZ                                                     ~3, ->10
  28     3    >   ROPE_INIT                                     4  ~5      !1
         4        ROPE_ADD                                      1  ~5      ~5, '+%2B+'
         5        ROPE_ADD                                      2  ~5      ~5, !2
         6        ROPE_END                                      3  ~4      ~5, '+%3D+'
         7        ECHO                                                     ~4
  29     8        ADD                                              ~7      !1, !2
         9        ECHO                                                     ~7
  32    10    >   IS_EQUAL                                         ~8      !0, 'sub'
        11      > JMPZ                                                     ~8, ->19
  33    12    >   ROPE_INIT                                     4  ~10     !1
        13        ROPE_ADD                                      1  ~10     ~10, '+-+'
        14        ROPE_ADD                                      2  ~10     ~10, !2
        15        ROPE_END                                      3  ~9      ~10, '+%3D+'
        16        ECHO                                                     ~9
  34    17        SUB                                              ~12     !1, !2
        18        ECHO                                                     ~12
  37    19    >   IS_EQUAL                                         ~13     !0, 'mul'
        20      > JMPZ                                                     ~13, ->28
  38    21    >   ROPE_INIT                                     4  ~15     !1
        22        ROPE_ADD                                      1  ~15     ~15, '+%2A+'
        23        ROPE_ADD                                      2  ~15     ~15, !2
        24        ROPE_END                                      3  ~14     ~15, '+%3D+'
        25        ECHO                                                     ~14
  39    26        MUL                                              ~17     !1, !2
        27        ECHO                                                     ~17
  42    28    >   IS_EQUAL                                         ~18     !0, 'div'
        29      > JMPZ                                                     ~18, ->37
  43    30    >   ROPE_INIT                                     4  ~20     !1
        31        ROPE_ADD                                      1  ~20     ~20, '+%2F+'
        32        ROPE_ADD                                      2  ~20     ~20, !2
        33        ROPE_END                                      3  ~19     ~20, '+%3D+'
        34        ECHO                                                     ~19
  44    35        DIV                                              ~22     !1, !2
        36        ECHO                                                     ~22
  52    37    >   ECHO                                                     '%0A%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
        38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0