3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button'; exit; } else { echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/npX2X
function name:  (null)
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~0      '_SERVER'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~1      ~0, 'PHP_AUTH_USER'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->13
    3     4    >   INIT_FCALL                                               'header'
          5        SEND_VAL                                                 'WWW-Authenticate%3A+Basic+realm%3D%22My+Realm%22'
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'header'
          8        SEND_VAL                                                 'HTTP%2F1.0+401+Unauthorized'
          9        DO_ICALL                                                 
    5    10        ECHO                                                     'Text+to+send+if+user+hits+Cancel+button'
    6    11      > EXIT                                                     
         12*       JMP                                                      ->25
    8    13    >   ROPE_INIT                                     3  ~8      '%3Cp%3EHello+'
         14        FETCH_R                      global              ~5      '_SERVER'
         15        FETCH_DIM_R                                      ~6      ~5, 'PHP_AUTH_USER'
         16        ROPE_ADD                                      1  ~8      ~8, ~6
         17        ROPE_END                                      2  ~7      ~8, '.%3C%2Fp%3E'
         18        ECHO                                                     ~7
    9    19        ROPE_INIT                                     3  ~13     '%3Cp%3EYou+entered+'
         20        FETCH_R                      global              ~10     '_SERVER'
         21        FETCH_DIM_R                                      ~11     ~10, 'PHP_AUTH_PW'
         22        ROPE_ADD                                      1  ~13     ~13, ~11
         23        ROPE_END                                      2  ~12     ~13, '+as+your+password.%3C%2Fp%3E'
         24        ECHO                                                     ~12
   11    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.92 ms | 1395 KiB | 15 Q