3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['auth']='{"data":{"login":"1","password":"0000000000000000000000000000000000000000000000000000000000000000"}}'; $PASSWORD_SHA256 = "9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0"; $USER = "aaa"; $return['status'] = 'Authentication failed!'; if (isset($_POST["auth"])) { // retrieve JSON data $auth = @json_decode($_POST['auth'], true); echo $auth['data']['password']."\n"; var_dump($auth); // check login and password (sha256) if($auth['data']['login'] == $USER && !strcmp($auth['data']['password'], $PASSWORD_SHA256)){ $return['status'] = "Access granted! The validation password is"; } } print json_encode($return); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 41
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 38
Branch analysis from position: 41
filename:       /in/9tRal
function name:  (null)
number of ops:  46
compiled vars:  !0 = $PASSWORD_SHA256, !1 = $USER, !2 = $return, !3 = $auth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_W                      global              $4      '_POST'
          1        ASSIGN_DIM                                               $4, 'auth'
          2        OP_DATA                                                  '%7B%22data%22%3A%7B%22login%22%3A%221%22%2C%22password%22%3A%220000000000000000000000000000000000000000000000000000000000000000%22%7D%7D'
    3     3        ASSIGN                                                   !0, '9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0'
    4     4        ASSIGN                                                   !1, 'aaa'
    6     5        ASSIGN_DIM                                               !2, 'status'
          6        OP_DATA                                                  'Authentication+failed%21'
    7     7        FETCH_IS                                         ~9      '_POST'
          8        ISSET_ISEMPTY_DIM_OBJ                         0          ~9, 'auth'
          9      > JMPZ                                                     ~10, ->41
    9    10    >   BEGIN_SILENCE                                    ~11     
         11        INIT_FCALL                                               'json_decode'
         12        FETCH_R                      global              ~12     '_POST'
         13        FETCH_DIM_R                                      ~13     ~12, 'auth'
         14        SEND_VAL                                                 ~13
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $14     
         17        END_SILENCE                                              ~11
         18        ASSIGN                                                   !3, $14
   11    19        FETCH_DIM_R                                      ~16     !3, 'data'
         20        FETCH_DIM_R                                      ~17     ~16, 'password'
         21        CONCAT                                           ~18     ~17, '%0A'
         22        ECHO                                                     ~18
   13    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
   16    26        FETCH_DIM_R                                      ~20     !3, 'data'
         27        FETCH_DIM_R                                      ~21     ~20, 'login'
         28        IS_EQUAL                                         ~22     !1, ~21
         29      > JMPZ_EX                                          ~22     ~22, ->38
         30    >   INIT_FCALL                                               'strcmp'
         31        FETCH_DIM_R                                      ~23     !3, 'data'
         32        FETCH_DIM_R                                      ~24     ~23, 'password'
         33        SEND_VAL                                                 ~24
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $25     
         36        BOOL_NOT                                         ~26     $25
         37        BOOL                                             ~22     ~26
         38    > > JMPZ                                                     ~22, ->41
   17    39    >   ASSIGN_DIM                                               !2, 'status'
         40        OP_DATA                                                  'Access+granted%21+The+validation+password+is'
   20    41    >   INIT_FCALL                                               'json_encode'
         42        SEND_VAR                                                 !2
         43        DO_ICALL                                         $28     
         44        ECHO                                                     $28
   21    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.09 ms | 1400 KiB | 21 Q