3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['email'] = 'test@mail.com'; $_POST['emailrepeat'] = 'test@gmail.com'; function cleanInput($input){ if(isset($_POST[$input])){ $input = $_POST[$input]; }else{ return false; } $input = htmlspecialchars($input); $input = trim($input); $input = stripslashes($input); return $input; } function isCorrectLength($input,$min,$max){ $x = mb_strlen($input); return ($x >= $min && $x <= $max); } if($email = cleanInput('email')){ if(filter_var($email, FILTER_VALIDATE_EMAIL)){ if(isCorrectLength($email,1,60)){ if(!$auth->isEmailTaken($email)){ $email_clean = $email; }else{ array_push($errorMessages,'Your email is already registered'); } }else{ array_push($errorMessage,'Your email is too long'); } }else{ array_push($errorMessages,'You entered an incorrect email'); } }else{ array_push($errorMessages,'You did not input an email'); } if($emailrepeat = cleanInput('emailrepeat')){ if(strcasecmp($email_clean, emailrepeat) != 0){ echo "$emailrepeat<br>$email_clean<br>"; array_push($errorMessages,'Your emails did not match'); } }else{ array_push($errorMessages,'You did not repeat your email'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 44
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 39
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 34
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 70
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 69
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 70
Branch analysis from position: 53
Branch analysis from position: 70
filename:       /in/Hv9hN
function name:  (null)
number of ops:  75
compiled vars:  !0 = $email, !1 = $auth, !2 = $email_clean, !3 = $errorMessages, !4 = $errorMessage, !5 = $emailrepeat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $6      '_POST'
          1        ASSIGN_DIM                                               $6, 'email'
          2        OP_DATA                                                  'test%40mail.com'
    4     3        FETCH_W                      global              $8      '_POST'
          4        ASSIGN_DIM                                               $8, 'emailrepeat'
          5        OP_DATA                                                  'test%40gmail.com'
   23     6        INIT_FCALL                                               'cleaninput'
          7        SEND_VAL                                                 'email'
          8        DO_FCALL                                      0  $10     
          9        ASSIGN                                           ~11     !0, $10
         10      > JMPZ                                                     ~11, ->44
   24    11    >   INIT_FCALL                                               'filter_var'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 274
         14        DO_ICALL                                         $12     
         15      > JMPZ                                                     $12, ->39
   25    16    >   INIT_FCALL                                               'iscorrectlength'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 1
         19        SEND_VAL                                                 60
         20        DO_FCALL                                      0  $13     
         21      > JMPZ                                                     $13, ->34
   26    22    >   INIT_METHOD_CALL                                         !1, 'isEmailTaken'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0  $14     
         25        BOOL_NOT                                         ~15     $14
         26      > JMPZ                                                     ~15, ->29
   27    27    >   ASSIGN                                                   !2, !0
         28      > JMP                                                      ->33
   29    29    >   INIT_FCALL                                               'array_push'
         30        SEND_REF                                                 !3
         31        SEND_VAL                                                 'Your+email+is+already+registered'
         32        DO_ICALL                                                 
         33    > > JMP                                                      ->38
   32    34    >   INIT_FCALL                                               'array_push'
         35        SEND_REF                                                 !4
         36        SEND_VAL                                                 'Your+email+is+too+long'
         37        DO_ICALL                                                 
         38    > > JMP                                                      ->43
   35    39    >   INIT_FCALL                                               'array_push'
         40        SEND_REF                                                 !3
         41        SEND_VAL                                                 'You+entered+an+incorrect+email'
         42        DO_ICALL                                                 
         43    > > JMP                                                      ->48
   38    44    >   INIT_FCALL                                               'array_push'
         45        SEND_REF                                                 !3
         46        SEND_VAL                                                 'You+did+not+input+an+email'
         47        DO_ICALL                                                 
   40    48    >   INIT_FCALL                                               'cleaninput'
         49        SEND_VAL                                                 'emailrepeat'
         50        DO_FCALL                                      0  $21     
         51        ASSIGN                                           ~22     !5, $21
         52      > JMPZ                                                     ~22, ->70
   41    53    >   INIT_FCALL                                               'strcasecmp'
         54        SEND_VAR                                                 !2
         55        FETCH_CONSTANT                                   ~23     'emailrepeat'
         56        SEND_VAL                                                 ~23
         57        DO_ICALL                                         $24     
         58        IS_NOT_EQUAL                                             $24, 0
         59      > JMPZ                                                     ~25, ->69
   42    60    >   ROPE_INIT                                     4  ~27     !5
         61        ROPE_ADD                                      1  ~27     ~27, '%3Cbr%3E'
         62        ROPE_ADD                                      2  ~27     ~27, !2
         63        ROPE_END                                      3  ~26     ~27, '%3Cbr%3E'
         64        ECHO                                                     ~26
   43    65        INIT_FCALL                                               'array_push'
         66        SEND_REF                                                 !3
         67        SEND_VAL                                                 'Your+emails+did+not+match'
         68        DO_ICALL                                                 
         69    > > JMP                                                      ->74
   46    70    >   INIT_FCALL                                               'array_push'
         71        SEND_REF                                                 !3
         72        SEND_VAL                                                 'You+did+not+repeat+your+email'
         73        DO_ICALL                                                 
   47    74    > > RETURN                                                   1

Function cleaninput:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hv9hN
function name:  cleanInput
number of ops:  23
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_IS                                         ~1      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->8
    8     4    >   FETCH_R                      global              ~3      '_POST'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6        ASSIGN                                                   !0, ~4
          7      > JMP                                                      ->9
   10     8    > > RETURN                                                   <false>
   12     9    >   INIT_FCALL                                               'htmlspecialchars'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !0, $6
   13    13        INIT_FCALL                                               'trim'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !0, $8
   14    17        INIT_FCALL                                               'stripslashes'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !0, $10
   15    21      > RETURN                                                   !0
   16    22*     > RETURN                                                   null

End of function cleaninput

Function iscorrectlength:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Hv9hN
function name:  isCorrectLength
number of ops:  13
compiled vars:  !0 = $input, !1 = $min, !2 = $max, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   19     3        INIT_FCALL                                               'mb_strlen'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !3, $4
   20     7        IS_SMALLER_OR_EQUAL                              ~6      !1, !3
          8      > JMPZ_EX                                          ~6      ~6, ->11
          9    >   IS_SMALLER_OR_EQUAL                              ~7      !3, !2
         10        BOOL                                             ~6      ~7
         11    > > RETURN                                                   ~6
   21    12*     > RETURN                                                   null

End of function iscorrectlength

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.8 ms | 1411 KiB | 30 Q