3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HTTP { private static $headers = array(); public static function redirect($newLocation, $temporary = false) { if($temporary) { header("HTTP/1.0 307 Temporary Redirect"); } else { header("HTTP/1.0 301 Moved Permanently"); } header("Location: " . $newLocation); exit(); } public static function objRedirect(URL $url, $temporary = false) { HTTP::redirect(Config::getValue("baseUrl") . $url, $temporary); } public static function disableCaching() { header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); } public static function addHeader($type, $content) { array_push(HTTP::$headers, array("type" => $type, "content" => $content)); } public static function getHeaders() { return HTTP::$headers; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQ393
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E > > RETURN                                                   1

Class HTTP:
Function redirect:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/UQ393
function name:  redirect
number of ops:  16
compiled vars:  !0 = $newLocation, !1 = $temporary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
    7     2      > JMPZ                                                     !1, ->7
    9     3    >   INIT_FCALL                                               'header'
          4        SEND_VAL                                                 'HTTP%2F1.0+307+Temporary+Redirect'
          5        DO_ICALL                                                 
          6      > JMP                                                      ->10
   13     7    >   INIT_FCALL                                               'header'
          8        SEND_VAL                                                 'HTTP%2F1.0+301+Moved+Permanently'
          9        DO_ICALL                                                 
   15    10    >   INIT_FCALL                                               'header'
         11        CONCAT                                           ~4      'Location%3A+', !0
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                                 
   16    14      > EXIT                                                     
   17    15*     > RETURN                                                   null

End of function redirect

Function objredirect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQ393
function name:  objRedirect
number of ops:  11
compiled vars:  !0 = $url, !1 = $temporary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   20     2        INIT_STATIC_METHOD_CALL                                  'HTTP', 'redirect'
          3        INIT_STATIC_METHOD_CALL                                  'Config', 'getValue'
          4        SEND_VAL_EX                                              'baseUrl'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, !0
          7        SEND_VAL                                                 ~3
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0          
   21    10      > RETURN                                                   null

End of function objredirect

Function disablecaching:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQ393
function name:  disableCaching
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Cache-Control%3A+no-cache%2C+must-revalidate'
          2        DO_ICALL                                                 
   25     3        INIT_FCALL                                               'header'
          4        SEND_VAL                                                 'Expires%3A+Sat%2C+26+Jul+1997+05%3A00%3A00+GMT'
          5        DO_ICALL                                                 
   26     6      > RETURN                                                   null

End of function disablecaching

Function addheader:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQ393
function name:  addHeader
number of ops:  10
compiled vars:  !0 = $type, !1 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   29     2        INIT_FCALL                                               'array_push'
          3        FETCH_STATIC_PROP_W          unknown             $2      'headers'
          4        SEND_REF                                                 $2
          5        INIT_ARRAY                                       ~3      !0, 'type'
          6        ADD_ARRAY_ELEMENT                                ~3      !1, 'content'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   30     9      > RETURN                                                   null

End of function addheader

Function getheaders:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQ393
function name:  getHeaders
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'headers'
          1      > RETURN                                                   ~0
   35     2*     > RETURN                                                   null

End of function getheaders

End of class HTTP.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.42 ms | 1404 KiB | 17 Q