3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!isset($_SESSION[' isLogged ']) == true) { if ($_POST) { $username = trim($_POST['username']); $pass = trim($_POST['pass']) ; $pass2 = trim($_POST['pass2']); $email = trim($_POST['email']); $error_array=array(); if (strlen($username) < 5) { $error_array['username'] = 'Кратко име.Трябва да е поне 4 синвола!'; } if (strlen($pass) < 4) { $error_array['pass'] = 'Кратка парола!'; } if ($pass != $pass2) { $error_array['pass2'] = 'Паролите не въпадат!'; } if (!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email)) { $error_array['email'] = 'Невалиден Email адрес!'; } if (!preg_match("/^[a-zA-Z0-9_]{5,16}$/", $username)) { $error_array['username'] = 'Невалидно име!'; } if (!isset($error_array) > 0) { $query->query($dbconnect, 'SELECT * FROM users WHERE user_name="'.$username.'" AND user_mail="'.$email.'"'); if ($query->num_rows) { echo '<center><b><h1>Username or Email is busy.Please try again!</h1></b></center>'; header("refresh:2;url=register.php"); exit; } else { mysqli_query($dbconnect, 'INSERT INTO users (user_name,user_pass,user_mail) VALUES("' . addslashes($username) . '","' . addslashes($pass) . '","' . addslashes($email) . '")'); echo '<center><h1><b>Registered is success!</b></h1></center>'; header("refresh:2;url=index.php"); exit; } } else { echo '<center><h1><b>All fields are required!</b></h1></center>'; } } else { echo '<center><h1><b>Registered is not complete!</b></h1></center>'; } } else { echo '<center><h1><b>Вече сте влезли в системата!</h1></b></center>'; header("refresh:2;url=index.php"); exit; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 111
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 109
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 107
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 82
Branch analysis from position: 76
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 82
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 107
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 54
Branch analysis from position: 46
Branch analysis from position: 42
Branch analysis from position: 37
Branch analysis from position: 109
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
Branch analysis from position: 111
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/CSqUt
function name:  (null)
number of ops:  117
compiled vars:  !0 = $username, !1 = $pass, !2 = $pass2, !3 = $email, !4 = $error_array, !5 = $query, !6 = $dbconnect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~7      '_SESSION'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      ~7, '+isLogged+'
          2        BOOL_NOT                                         ~9      ~8
          3        BOOL                                             ~10     ~9
          4      > JMPZ                                                     ~10, ->111
    3     5    >   FETCH_R                      global              ~11     '_POST'
          6      > JMPZ                                                     ~11, ->109
    4     7    >   INIT_FCALL                                               'trim'
          8        FETCH_R                      global              ~12     '_POST'
          9        FETCH_DIM_R                                      ~13     ~12, 'username'
         10        SEND_VAL                                                 ~13
         11        DO_ICALL                                         $14     
         12        ASSIGN                                                   !0, $14
    5    13        INIT_FCALL                                               'trim'
         14        FETCH_R                      global              ~16     '_POST'
         15        FETCH_DIM_R                                      ~17     ~16, 'pass'
         16        SEND_VAL                                                 ~17
         17        DO_ICALL                                         $18     
         18        ASSIGN                                                   !1, $18
    6    19        INIT_FCALL                                               'trim'
         20        FETCH_R                      global              ~20     '_POST'
         21        FETCH_DIM_R                                      ~21     ~20, 'pass2'
         22        SEND_VAL                                                 ~21
         23        DO_ICALL                                         $22     
         24        ASSIGN                                                   !2, $22
    7    25        INIT_FCALL                                               'trim'
         26        FETCH_R                      global              ~24     '_POST'
         27        FETCH_DIM_R                                      ~25     ~24, 'email'
         28        SEND_VAL                                                 ~25
         29        DO_ICALL                                         $26     
         30        ASSIGN                                                   !3, $26
    8    31        ASSIGN                                                   !4, <array>
    9    32        STRLEN                                           ~29     !0
         33        IS_SMALLER                                               ~29, 5
         34      > JMPZ                                                     ~30, ->37
   10    35    >   ASSIGN_DIM                                               !4, 'username'
         36        OP_DATA                                                  '%D0%9A%D1%80%D0%B0%D1%82%D0%BA%D0%BE+%D0%B8%D0%BC%D0%B5.%D0%A2%D1%80%D1%8F%D0%B1%D0%B2%D0%B0+%D0%B4%D0%B0+%D0%B5+%D0%BF%D0%BE%D0%BD%D0%B5+4+%D1%81%D0%B8%D0%BD%D0%B2%D0%BE%D0%BB%D0%B0%21'
   12    37    >   STRLEN                                           ~32     !1
         38        IS_SMALLER                                               ~32, 4
         39      > JMPZ                                                     ~33, ->42
   13    40    >   ASSIGN_DIM                                               !4, 'pass'
         41        OP_DATA                                                  '%D0%9A%D1%80%D0%B0%D1%82%D0%BA%D0%B0+%D0%BF%D0%B0%D1%80%D0%BE%D0%BB%D0%B0%21'
   15    42    >   IS_NOT_EQUAL                                             !1, !2
         43      > JMPZ                                                     ~35, ->46
   16    44    >   ASSIGN_DIM                                               !4, 'pass2'
         45        OP_DATA                                                  '%D0%9F%D0%B0%D1%80%D0%BE%D0%BB%D0%B8%D1%82%D0%B5+%D0%BD%D0%B5+%D0%B2%D1%8A%D0%BF%D0%B0%D0%B4%D0%B0%D1%82%21'
   18    46    >   INIT_FCALL                                               'preg_match'
         47        SEND_VAL                                                 '%2F%5E%28%5Ba-zA-Z0-9%5D%29%2B%28%5Ba-zA-Z0-9%5C._-%5D%29%2A%40%28%5Ba-zA-Z0-9_-%5D%29%2B%28%5Ba-zA-Z0-9%5C._-%5D%2B%29%2B%24%2F'
         48        SEND_VAR                                                 !3
         49        DO_ICALL                                         $37     
         50        BOOL_NOT                                         ~38     $37
         51      > JMPZ                                                     ~38, ->54
   19    52    >   ASSIGN_DIM                                               !4, 'email'
         53        OP_DATA                                                  '%D0%9D%D0%B5%D0%B2%D0%B0%D0%BB%D0%B8%D0%B4%D0%B5%D0%BD+Email+%D0%B0%D0%B4%D1%80%D0%B5%D1%81%21'
   21    54    >   INIT_FCALL                                               'preg_match'
         55        SEND_VAL                                                 '%2F%5E%5Ba-zA-Z0-9_%5D%7B5%2C16%7D%24%2F'
         56        SEND_VAR                                                 !0
         57        DO_ICALL                                         $40     
         58        BOOL_NOT                                         ~41     $40
         59      > JMPZ                                                     ~41, ->62
   22    60    >   ASSIGN_DIM                                               !4, 'username'
         61        OP_DATA                                                  '%D0%9D%D0%B5%D0%B2%D0%B0%D0%BB%D0%B8%D0%B4%D0%BD%D0%BE+%D0%B8%D0%BC%D0%B5%21'
   24    62    >   ISSET_ISEMPTY_CV                                 ~43     !4
         63        BOOL_NOT                                         ~44     ~43
         64        IS_SMALLER                                               0, ~44
         65      > JMPZ                                                     ~45, ->107
   25    66    >   INIT_METHOD_CALL                                         !5, 'query'
         67        SEND_VAR_EX                                              !6
         68        CONCAT                                           ~46     'SELECT+%2A+FROM+users+WHERE+user_name%3D%22', !0
         69        CONCAT                                           ~47     ~46, '%22+AND+user_mail%3D%22'
         70        CONCAT                                           ~48     ~47, !3
         71        CONCAT                                           ~49     ~48, '%22'
         72        SEND_VAL_EX                                              ~49
         73        DO_FCALL                                      0          
   26    74        FETCH_OBJ_R                                      ~51     !5, 'num_rows'
         75      > JMPZ                                                     ~51, ->82
   27    76    >   ECHO                                                     '%3Ccenter%3E%3Cb%3E%3Ch1%3EUsername+or+Email+is+busy.Please+try+again%21%3C%2Fh1%3E%3C%2Fb%3E%3C%2Fcenter%3E'
   28    77        INIT_FCALL                                               'header'
         78        SEND_VAL                                                 'refresh%3A2%3Burl%3Dregister.php'
         79        DO_ICALL                                                 
   29    80      > EXIT                                                     
         81*       JMP                                                      ->106
   31    82    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
         83        SEND_VAR_EX                                              !6
   32    84        INIT_FCALL                                               'addslashes'
         85        SEND_VAR                                                 !0
         86        DO_ICALL                                         $53     
         87        CONCAT                                           ~54     'INSERT+INTO+users+%28user_name%2Cuser_pass%2Cuser_mail%29+%0A++++++++++++++++VALUES%28%22', $53
         88        CONCAT                                           ~55     ~54, '%22%2C%22'
         89        INIT_FCALL                                               'addslashes'
         90        SEND_VAR                                                 !1
         91        DO_ICALL                                         $56     
         92        CONCAT                                           ~57     ~55, $56
         93        CONCAT                                           ~58     ~57, '%22%2C%22'
         94        INIT_FCALL                                               'addslashes'
         95        SEND_VAR                                                 !3
         96        DO_ICALL                                         $59     
         97        CONCAT                                           ~60     ~58, $59
         98        CONCAT                                           ~61     ~60, '%22%29'
         99        SEND_VAL_EX                                              ~61
        100        DO_FCALL                                      0          
   33   101        ECHO                                                     '%3Ccenter%3E%3Ch1%3E%3Cb%3ERegistered+is+success%21%3C%2Fb%3E%3C%2Fh1%3E%3C%2Fcenter%3E'
   34   102        INIT_FCALL                                               'header'
        103        SEND_VAL                                                 'refresh%3A2%3Burl%3Dindex.php'
        104        DO_ICALL                                                 
   35   105      > EXIT                                                     
        106*       JMP                                                      ->108
   38   107    >   ECHO                                                     '%3Ccenter%3E%3Ch1%3E%3Cb%3EAll+fields+are+required%21%3C%2Fb%3E%3C%2Fh1%3E%3C%2Fcenter%3E'
        108      > JMP                                                      ->110
   41   109    >   ECHO                                                     '%3Ccenter%3E%3Ch1%3E%3Cb%3ERegistered+is+not+complete%21%3C%2Fb%3E%3C%2Fh1%3E%3C%2Fcenter%3E'
        110    > > JMP                                                      ->116
   44   111    >   ECHO                                                     '%3Ccenter%3E%3Ch1%3E%3Cb%3E%D0%92%D0%B5%D1%87%D0%B5+%D1%81%D1%82%D0%B5+%D0%B2%D0%BB%D0%B5%D0%B7%D0%BB%D0%B8+%D0%B2+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B0%21%3C%2Fh1%3E%3C%2Fb%3E%3C%2Fcenter%3E'
   45   112        INIT_FCALL                                               'header'
        113        SEND_VAL                                                 'refresh%3A2%3Burl%3Dindex.php'
        114        DO_ICALL                                                 
   46   115      > EXIT                                                     
   47   116    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.63 ms | 1408 KiB | 21 Q