3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f=$c= ""; if(isset($_POST['f'])) $f=sanitizeString($_POST['f']); if(isset($_POST['c'])) $c=sanitizeString($_POST['c']); if($f!= '') { $c=intval((5/9)*($f-32)); $out="$f degree farenheit equals $c degree celsius"; } elseif($c!= '') { $f=intval((9/5)* $c + 32); $out="$c degree celsius equals $f degree farenheit"; } else $out= ""; echo <<<_END <html><head><title>Temparature Converter</title> </head><body><pre> Enter either Fahrenheit or Celsius and click on Convert <b>$out</b> <form method="post" action="convert.php"> Fahrenheit <input type="text" name="f" size="7"/> Celsius <input type="text" name="c" size="7"/> <input type="submit" value="convert" /> </form> </pre> </body> </html> _END; function sanitizeString($var) { $var=stripslashes($var); $var=htmlentities($var); $var=strip_tags($var); return $var; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 34
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 46
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 12
filename:       /in/hm4kA
function name:  (null)
number of ops:  52
compiled vars:  !0 = $f, !1 = $c, !2 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                           ~3      !1, ''
          1        ASSIGN                                                   !0, ~3
    3     2        FETCH_IS                                         ~5      '_POST'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~5, 'f'
          4      > JMPZ                                                     ~6, ->12
          5    >   INIT_FCALL_BY_NAME                                       'sanitizeString'
          6        CHECK_FUNC_ARG                                           
          7        FETCH_FUNC_ARG               global              $7      '_POST'
          8        FETCH_DIM_FUNC_ARG                               $8      $7, 'f'
          9        SEND_FUNC_ARG                                            $8
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !0, $9
    4    12    >   FETCH_IS                                         ~11     '_POST'
         13        ISSET_ISEMPTY_DIM_OBJ                         0          ~11, 'c'
         14      > JMPZ                                                     ~12, ->22
         15    >   INIT_FCALL_BY_NAME                                       'sanitizeString'
         16        CHECK_FUNC_ARG                                           
         17        FETCH_FUNC_ARG               global              $13     '_POST'
         18        FETCH_DIM_FUNC_ARG                               $14     $13, 'c'
         19        SEND_FUNC_ARG                                            $14
         20        DO_FCALL                                      0  $15     
         21        ASSIGN                                                   !1, $15
    6    22    >   IS_NOT_EQUAL                                             !0, ''
         23      > JMPZ                                                     ~17, ->34
    8    24    >   SUB                                              ~18     !0, 32
         25        MUL                                              ~19     ~18, 0.555556
         26        CAST                                          4  ~20     ~19
         27        ASSIGN                                                   !1, ~20
    9    28        ROPE_INIT                                     4  ~23     !0
         29        ROPE_ADD                                      1  ~23     ~23, '+degree+farenheit+equals+'
         30        ROPE_ADD                                      2  ~23     ~23, !1
         31        ROPE_END                                      3  ~22     ~23, '+degree+celsius'
         32        ASSIGN                                                   !2, ~22
         33      > JMP                                                      ->47
   11    34    >   IS_NOT_EQUAL                                             !1, ''
         35      > JMPZ                                                     ~26, ->46
   13    36    >   MUL                                              ~27     !1, 1.8
         37        ADD                                              ~28     ~27, 32
         38        CAST                                          4  ~29     ~28
         39        ASSIGN                                                   !0, ~29
   14    40        ROPE_INIT                                     4  ~32     !1
         41        ROPE_ADD                                      1  ~32     ~32, '+degree+celsius+equals+'
         42        ROPE_ADD                                      2  ~32     ~32, !0
         43        ROPE_END                                      3  ~31     ~32, '+degree+farenheit'
         44        ASSIGN                                                   !2, ~31
         45      > JMP                                                      ->47
   16    46    >   ASSIGN                                                   !2, ''
   20    47    >   ROPE_INIT                                     3  ~37     '+%3Chtml%3E%3Chead%3E%3Ctitle%3ETemparature+Converter%3C%2Ftitle%3E%0A+%3C%2Fhead%3E%3Cbody%3E%3Cpre%3E%0A+Enter+either+Fahrenheit+or+Celsius+and+click+on+Convert%0A+%3Cb%3E'
   23    48        ROPE_ADD                                      1  ~37     ~37, !2
         49        ROPE_END                                      2  ~36     ~37, '%3C%2Fb%3E%0A+%3Cform+method%3D%22post%22+action%3D%22convert.php%22%3E%0A+Fahrenheit+%3Cinput+type%3D%22text%22+name%3D%22f%22+size%3D%227%22%2F%3E%0A+Celsius+%3Cinput+type%3D%22text%22+name%3D%22c%22+size%3D%227%22%2F%3E%0A++%3Cinput+type%3D%22submit%22++value%3D%22convert%22+%2F%3E%0A++%3C%2Fform%3E%0A++%3C%2Fpre%3E%0A++%3C%2Fbody%3E%0A++%3C%2Fhtml%3E'
         50        ECHO                                                     ~36
   41    51      > RETURN                                                   1

Function sanitizestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hm4kA
function name:  sanitizeString
number of ops:  15
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        INIT_FCALL                                               'stripslashes'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   37     5        INIT_FCALL                                               'htmlentities'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
   38     9        INIT_FCALL                                               'strip_tags'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !0, $5
   39    13      > RETURN                                                   !0
   40    14*     > RETURN                                                   null

End of function sanitizestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.07 ms | 1400 KiB | 19 Q