3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['submit'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "seedat8@gmail.com"; $email_subject = "Big Match Project"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['name']) || !isset($_POST['email']) || !isset($_POST['messages'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; // required $email_from = $_POST['email']; // required $messages = $_POST['messages']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(strlen($messages) < 2) { $error_message .= 'The messages you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "messages: ".clean_string($messages)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 97
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 53
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 59
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 53
Branch analysis from position: 49
Branch analysis from position: 41
Branch analysis from position: 23
Branch analysis from position: 19
Branch analysis from position: 14
Branch analysis from position: 97
filename:       /in/6igbg
function name:  (null)
number of ops:  98
compiled vars:  !0 = $email_to, !1 = $email_subject, !2 = $name, !3 = $email_from, !4 = $messages, !5 = $error_message, !6 = $email_exp, !7 = $string_exp, !8 = $email_message, !9 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_IS                                         ~10     '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~10, 'submit'
          2      > JMPZ                                                     ~11, ->97
    9     3    >   ASSIGN                                                   !0, 'seedat8%40gmail.com'
   11     4        ASSIGN                                                   !1, 'Big+Match+Project'
   17     5        DECLARE_FUNCTION                                         'died'
   37     6        FETCH_IS                                         ~14     '_POST'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     ~14, 'name'
          8        BOOL_NOT                                         ~16     ~15
          9      > JMPNZ_EX                                         ~16     ~16, ->14
   39    10    >   FETCH_IS                                         ~17     '_POST'
         11        ISSET_ISEMPTY_DIM_OBJ                         0  ~18     ~17, 'email'
         12        BOOL_NOT                                         ~19     ~18
         13        BOOL                                             ~16     ~19
         14    > > JMPNZ_EX                                         ~16     ~16, ->19
   41    15    >   FETCH_IS                                         ~20     '_POST'
         16        ISSET_ISEMPTY_DIM_OBJ                         0  ~21     ~20, 'messages'
         17        BOOL_NOT                                         ~22     ~21
         18        BOOL                                             ~16     ~22
         19    > > JMPZ                                                     ~16, ->23
   43    20    >   INIT_FCALL_BY_NAME                                       'died'
         21        SEND_VAL_EX                                              'We+are+sorry%2C+but+there+appears+to+be+a+problem+with+the+form+you+submitted.'
         22        DO_FCALL                                      0          
   49    23    >   FETCH_R                      global              ~24     '_POST'
         24        FETCH_DIM_R                                      ~25     ~24, 'name'
         25        ASSIGN                                                   !2, ~25
   51    26        FETCH_R                      global              ~27     '_POST'
         27        FETCH_DIM_R                                      ~28     ~27, 'email'
         28        ASSIGN                                                   !3, ~28
   53    29        FETCH_R                      global              ~30     '_POST'
         30        FETCH_DIM_R                                      ~31     ~30, 'messages'
         31        ASSIGN                                                   !4, ~31
   57    32        ASSIGN                                                   !5, ''
   59    33        ASSIGN                                                   !6, '%2F%5E%5BA-Za-z0-9._%25-%5D%2B%40%5BA-Za-z0-9.-%5D%2B%5C.%5BA-Za-z%5D%7B2%2C4%7D%24%2F'
   61    34        INIT_FCALL                                               'preg_match'
         35        SEND_VAR                                                 !6
         36        SEND_VAR                                                 !3
         37        DO_ICALL                                         $35     
         38        BOOL_NOT                                         ~36     $35
         39      > JMPZ                                                     ~36, ->41
   63    40    >   ASSIGN_OP                                     8          !5, 'The+Email+Address+you+entered+does+not+appear+to+be+valid.%3Cbr+%2F%3E'
   67    41    >   ASSIGN                                                   !7, '%2F%5E%5BA-Za-z+.%27-%5D%2B%24%2F'
   69    42        INIT_FCALL                                               'preg_match'
         43        SEND_VAR                                                 !7
         44        SEND_VAR                                                 !2
         45        DO_ICALL                                         $39     
         46        BOOL_NOT                                         ~40     $39
         47      > JMPZ                                                     ~40, ->49
   71    48    >   ASSIGN_OP                                     8          !5, 'The+First+Name+you+entered+does+not+appear+to+be+valid.%3Cbr+%2F%3E'
   76    49    >   STRLEN                                           ~42     !4
         50        IS_SMALLER                                               ~42, 2
         51      > JMPZ                                                     ~43, ->53
   78    52    >   ASSIGN_OP                                     8          !5, 'The+messages+you+entered+do+not+appear+to+be+valid.%3Cbr+%2F%3E'
   82    53    >   STRLEN                                           ~45     !5
         54        IS_SMALLER                                               0, ~45
         55      > JMPZ                                                     ~46, ->59
   84    56    >   INIT_FCALL_BY_NAME                                       'died'
         57        SEND_VAR_EX                                              !5
         58        DO_FCALL                                      0          
   88    59    >   ASSIGN                                                   !8, 'Form+details+below.%0A%0A'
   92    60        DECLARE_FUNCTION                                         'clean_string'
  102    61        INIT_FCALL_BY_NAME                                       'clean_string'
         62        SEND_VAR_EX                                              !2
         63        DO_FCALL                                      0  $49     
         64        CONCAT                                           ~50     'First+Name%3A+', $49
         65        CONCAT                                           ~51     ~50, '%0A'
         66        ASSIGN_OP                                     8          !8, ~51
  105    67        INIT_FCALL_BY_NAME                                       'clean_string'
         68        SEND_VAR_EX                                              !3
         69        DO_FCALL                                      0  $53     
         70        CONCAT                                           ~54     'Email%3A+', $53
         71        CONCAT                                           ~55     ~54, '%0A'
         72        ASSIGN_OP                                     8          !8, ~55
  107    73        INIT_FCALL_BY_NAME                                       'clean_string'
         74        SEND_VAR_EX                                              !4
         75        DO_FCALL                                      0  $57     
         76        CONCAT                                           ~58     'messages%3A+', $57
         77        CONCAT                                           ~59     ~58, '%0A'
         78        ASSIGN_OP                                     8          !8, ~59
  115    79        CONCAT                                           ~61     'From%3A+', !3
         80        CONCAT                                           ~62     ~61, '%0D%0A'
  117    81        CONCAT                                           ~63     ~62, 'Reply-To%3A+'
         82        CONCAT                                           ~64     ~63, !3
         83        CONCAT                                           ~65     ~64, '%0D%0A'
  119    84        CONCAT                                           ~66     ~65, 'X-Mailer%3A+PHP%2F'
         85        INIT_FCALL                                               'phpversion'
         86        DO_ICALL                                         $67     
         87        CONCAT                                           ~68     ~66, $67
  115    88        ASSIGN                                                   !9, ~68
  121    89        BEGIN_SILENCE                                    ~70     
         90        INIT_FCALL                                               'mail'
         91        SEND_VAR                                                 !0
         92        SEND_VAR                                                 !1
         93        SEND_VAR                                                 !8
         94        SEND_VAR                                                 !9
         95        DO_ICALL                                                 
         96        END_SILENCE                                              ~70
  126    97    > > RETURN                                                   1

Function %00died%2Fin%2F6igbg%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/6igbg
function name:  died
number of ops:  8
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   21     1        ECHO                                                     'We+are+very+sorry%2C+but+there+were+error%28s%29+found+with+the+form+you+submitted.+'
   23     2        ECHO                                                     'These+errors+appear+below.%3Cbr+%2F%3E%3Cbr+%2F%3E'
   25     3        CONCAT                                           ~1      !0, '%3Cbr+%2F%3E%3Cbr+%2F%3E'
          4        ECHO                                                     ~1
   27     5        ECHO                                                     'Please+go+back+and+fix+these+errors.%3Cbr+%2F%3E%3Cbr+%2F%3E'
   29     6      > EXIT                                                     
   31     7*     > RETURN                                                   null

End of function %00died%2Fin%2F6igbg%3A17%240

Function %00clean_string%2Fin%2F6igbg%3A92%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6igbg
function name:  clean_string
number of ops:  9
compiled vars:  !0 = $string, !1 = $bad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   92     0  E >   RECV                                             !0      
   94     1        ASSIGN                                                   !1, <array>
   96     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
   98     8*     > RETURN                                                   null

End of function %00clean_string%2Fin%2F6igbg%3A92%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.65 ms | 1408 KiB | 21 Q