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']; 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 = 40
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 37
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 40
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 37
Branch analysis from position: 40
filename:       /in/gWKDV
function name:  (null)
number of ops:  45
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, ->40
    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        ECHO                                                     ~17
   13    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   16    25        FETCH_DIM_R                                      ~19     !3, 'data'
         26        FETCH_DIM_R                                      ~20     ~19, 'login'
         27        IS_EQUAL                                         ~21     !1, ~20
         28      > JMPZ_EX                                          ~21     ~21, ->37
         29    >   INIT_FCALL                                               'strcmp'
         30        FETCH_DIM_R                                      ~22     !3, 'data'
         31        FETCH_DIM_R                                      ~23     ~22, 'password'
         32        SEND_VAL                                                 ~23
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $24     
         35        BOOL_NOT                                         ~25     $24
         36        BOOL                                             ~21     ~25
         37    > > JMPZ                                                     ~21, ->40
   17    38    >   ASSIGN_DIM                                               !2, 'status'
         39        OP_DATA                                                  'Access+granted%21+The+validation+password+is'
   20    40    >   INIT_FCALL                                               'json_encode'
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                         $27     
         43        ECHO                                                     $27
   21    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.13 ms | 1405 KiB | 21 Q