3v4l.org

run code in 300+ PHP versions simultaneously
<?php // SpaceBoard - the board with support for spaces // Copyright (C) 2012 GlitchMr // We have to expect PHP 4.0.0 without extensions until end of the tests. // Hack protection if (file_exists('../storage/sql.php')) { die('Please delete <kbd>storage/sql.php</kbd> to continue.'); } session_start(); if (!empty($_GET['ignore_errors'])) { $_SESSION['space_ignore_errors'] = true; } $errors = array(); // If version_compare doesn't exist then you're seriously screwed. if (!function_exists('version_compare') || version_compare(PHP_VERSION, '5.2.4', '<') ) { $errors[] = 'You\'re using PHP ' . htmlspecialchars(PHP_VERSION) . ' but you need at least PHP 5.2.4'; } if (!class_exists('mysqli')) { $errors[] = '<code>mysqli</code> not found, but it\'s required.'; } if (!function_exists('mb_strlen')) { $errors[] = 'Multibyte String for PHP is not installed. It\'s required.'; } if (!function_exists('preg_match')) { $errors[] = 'Your PHP installation doesn\'t have PCRE. It\'s required ' . 'for SpaceBoard to work.'; } if (ini_get('register_globals')) { $errors[] = 'Your server has <a href="http://www.php.net/manual/en/' . 'security.globals.php">register_globals</a> enabled. It\'s' . ' unsupported and attempting to continue may result your ' . 'board being hacked.'; } if (!file_exists('../storage/plugins')) { // Make basic file storage for tests @mkdir('../storage'); @mkdir('../storage/3rdparty'); @mkdir('../storage/3rdparty/twig'); @mkdir('../storage/plugins'); } // If it doesn't exist after creation something went wrong. if (!file_exists('../storage/plugins')) { $errors[] = 'Your filesystem isn\'t writable. Make <kbd>storage</kbd> ' . 'directory in main directory of your board and give it ' . 'read and write rights.'; } if ($errors && empty($_SESSION['space_ignore_errors'])) { echo '<!DOCTYPE html><title>Runtime error!</title>', '<div style="border-top: 5px solid red;', 'border-bottom: 5px solid red;', 'background: #FEE;', 'padding: 5px">', '<p>Sorry, but your server cannot run SpaceBoard.<ul>'; foreach ($errors as $error) { echo "<li>$error"; } echo '</ul><p>Or, if you really want to continue you may ', '<a href="?ignore_errors=1">continue</a>. You have been warned ', 'through. Don\'t complain if your installation won\'t work.</div>'; exit; } // If we are at this point that means everything should be fine. We may load // installer and write stuff without bothering about lack of compatibility. chdir('..'); require_once 'lib/basics.php'; require_once 'lib/twig.php'; require_once 'lib/i18n.php'; require_once 'lib/functions.php'; require_once 'lib/sql.php'; // Initialize $error variable. $error = null; // The board doesn't exist, but we should know the theme. $theme = 'spaceboard'; // Also, language should be set to English $lang = 'en'; $fields = array( 'dbserver' => array( 'name' => __('install_server'), 'hint' => __('install_server_hint'), 'type' => 'text', 'value' => issetor($_POST['dbserver'], 'localhost'), ), 'dbname' => array( 'name' => __('install_name'), 'type' => 'text', 'value' => issetor($_POST['dbname'], ''), ), 'dbuser' => array( 'name' => __('install_user'), 'type' => 'text', 'value' => issetor($_POST['dbuser'], ''), ), 'dbpass' => array( 'name' => __('install_password'), 'type' => 'password', 'value' => issetor($_POST['dbpass'], ''), ), 'dbprefix' => array( 'name' => __('install_prefix'), 'hint' => __('install_prefix_hint'), 'type' => 'text', 'value' => issetor($_POST['dbprefix'], 'space_'), ), 'dbport' => array( 'name' => __('install_port'), 'hint' => __('install_port_hint'), 'type' => 'number', 'value' => issetor($_POST['dbport'], 3306), ), 'submit' => array( 'name' => __('install_submit'), 'type' => 'submit', 'value' => __('install_submit_button'), ), );
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 = 79) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 47) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 34
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 86
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 93
Branch analysis from position: 91
2 jumps found. (Code = 46) Position 1 = 94, Position 2 = 97
Branch analysis from position: 94
2 jumps found. (Code = 43) Position 1 = 98, Position 2 = 115
Branch analysis from position: 98
2 jumps found. (Code = 77) Position 1 = 105, Position 2 = 110
Branch analysis from position: 105
2 jumps found. (Code = 78) Position 1 = 106, Position 2 = 110
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
Branch analysis from position: 110
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 110
Branch analysis from position: 115
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 97
Branch analysis from position: 93
Branch analysis from position: 86
Branch analysis from position: 61
Branch analysis from position: 55
Branch analysis from position: 48
Branch analysis from position: 41
Branch analysis from position: 34
Branch analysis from position: 26
Branch analysis from position: 14
filename:       /in/XXkfX
function name:  (null)
number of ops:  234
compiled vars:  !0 = $errors, !1 = $error, !2 = $theme, !3 = $lang, !4 = $fields
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'file_exists'
          1        SEND_VAL                                                 '..%2Fstorage%2Fsql.php'
          2        DO_ICALL                                         $5      
          3      > JMPZ                                                     $5, ->5
    9     4    > > EXIT                                                     'Please+delete+%3Ckbd%3Estorage%2Fsql.php%3C%2Fkbd%3E+to+continue.'
   12     5    >   INIT_FCALL                                               'session_start'
          6        DO_ICALL                                                 
   13     7        FETCH_IS                                         ~7      '_GET'
          8        ISSET_ISEMPTY_DIM_OBJ                         1  ~8      ~7, 'ignore_errors'
          9        BOOL_NOT                                         ~9      ~8
         10      > JMPZ                                                     ~9, ->14
   14    11    >   FETCH_W                      global              $10     '_SESSION'
         12        ASSIGN_DIM                                               $10, 'space_ignore_errors'
         13        OP_DATA                                                  <true>
   17    14    >   ASSIGN                                                   !0, <array>
   20    15        INIT_FCALL                                               'function_exists'
         16        SEND_VAL                                                 'version_compare'
         17        DO_ICALL                                         $13     
         18        BOOL_NOT                                         ~14     $13
         19      > JMPNZ_EX                                         ~14     ~14, ->26
   21    20    >   INIT_FCALL                                               'version_compare'
         21        SEND_VAL                                                 '8.0.0'
         22        SEND_VAL                                                 '5.2.4'
         23        SEND_VAL                                                 '%3C'
         24        DO_ICALL                                         $15     
         25        BOOL                                             ~14     $15
         26    > > JMPZ                                                     ~14, ->34
   23    27    >   INIT_FCALL                                               'htmlspecialchars'
         28        SEND_VAL                                                 '8.0.0'
         29        DO_ICALL                                         $17     
         30        CONCAT                                           ~18     'You%27re+using+PHP+', $17
   24    31        CONCAT                                           ~19     ~18, '+but+you+need+at+least+PHP+5.2.4'
   23    32        ASSIGN_DIM                                               !0
   24    33        OP_DATA                                                  ~19
   26    34    >   INIT_FCALL                                               'class_exists'
         35        SEND_VAL                                                 'mysqli'
         36        DO_ICALL                                         $20     
         37        BOOL_NOT                                         ~21     $20
         38      > JMPZ                                                     ~21, ->41
   27    39    >   ASSIGN_DIM                                               !0
         40        OP_DATA                                                  '%3Ccode%3Emysqli%3C%2Fcode%3E+not+found%2C+but+it%27s+required.'
   29    41    >   INIT_FCALL                                               'function_exists'
         42        SEND_VAL                                                 'mb_strlen'
         43        DO_ICALL                                         $23     
         44        BOOL_NOT                                         ~24     $23
         45      > JMPZ                                                     ~24, ->48
   30    46    >   ASSIGN_DIM                                               !0
         47        OP_DATA                                                  'Multibyte+String+for+PHP+is+not+installed.+It%27s+required.'
   32    48    >   INIT_FCALL                                               'function_exists'
         49        SEND_VAL                                                 'preg_match'
         50        DO_ICALL                                         $26     
         51        BOOL_NOT                                         ~27     $26
         52      > JMPZ                                                     ~27, ->55
   33    53    >   ASSIGN_DIM                                               !0
   34    54        OP_DATA                                                  'Your+PHP+installation+doesn%27t+have+PCRE.+It%27s+required+for+SpaceBoard+to+work.'
   36    55    >   INIT_FCALL                                               'ini_get'
         56        SEND_VAL                                                 'register_globals'
         57        DO_ICALL                                         $29     
         58      > JMPZ                                                     $29, ->61
   37    59    >   ASSIGN_DIM                                               !0
   40    60        OP_DATA                                                  'Your+server+has+%3Ca+href%3D%22http%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Fsecurity.globals.php%22%3Eregister_globals%3C%2Fa%3E+enabled.+It%27s+unsupported+and+attempting+to+continue+may+result+your+board+being+hacked.'
   43    61    >   INIT_FCALL                                               'file_exists'
         62        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         63        DO_ICALL                                         $31     
         64        BOOL_NOT                                         ~32     $31
         65      > JMPZ                                                     ~32, ->86
   45    66    >   BEGIN_SILENCE                                    ~33     
         67        INIT_FCALL                                               'mkdir'
         68        SEND_VAL                                                 '..%2Fstorage'
         69        DO_ICALL                                                 
         70        END_SILENCE                                              ~33
   46    71        BEGIN_SILENCE                                    ~35     
         72        INIT_FCALL                                               'mkdir'
         73        SEND_VAL                                                 '..%2Fstorage%2F3rdparty'
         74        DO_ICALL                                                 
         75        END_SILENCE                                              ~35
   47    76        BEGIN_SILENCE                                    ~37     
         77        INIT_FCALL                                               'mkdir'
         78        SEND_VAL                                                 '..%2Fstorage%2F3rdparty%2Ftwig'
         79        DO_ICALL                                                 
         80        END_SILENCE                                              ~37
   48    81        BEGIN_SILENCE                                    ~39     
         82        INIT_FCALL                                               'mkdir'
         83        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         84        DO_ICALL                                                 
         85        END_SILENCE                                              ~39
   52    86    >   INIT_FCALL                                               'file_exists'
         87        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         88        DO_ICALL                                         $41     
         89        BOOL_NOT                                         ~42     $41
         90      > JMPZ                                                     ~42, ->93
   53    91    >   ASSIGN_DIM                                               !0
   55    92        OP_DATA                                                  'Your+filesystem+isn%27t+writable.+Make+%3Ckbd%3Estorage%3C%2Fkbd%3E+directory+in+main+directory+of+your+board+and+give+it+read+and+write+rights.'
   58    93    > > JMPZ_EX                                          ~44     !0, ->97
         94    >   FETCH_IS                                         ~45     '_SESSION'
         95        ISSET_ISEMPTY_DIM_OBJ                         1  ~46     ~45, 'space_ignore_errors'
         96        BOOL                                             ~44     ~46
         97    > > JMPZ                                                     ~44, ->115
   59    98    >   ECHO                                                     '%3C%21DOCTYPE+html%3E%3Ctitle%3ERuntime+error%21%3C%2Ftitle%3E'
   60    99        ECHO                                                     '%3Cdiv+style%3D%22border-top%3A+5px+solid+red%3B'
   61   100        ECHO                                                     'border-bottom%3A+5px+solid+red%3B'
   62   101        ECHO                                                     'background%3A+%23FEE%3B'
   63   102        ECHO                                                     'padding%3A+5px%22%3E'
   64   103        ECHO                                                     '%3Cp%3ESorry%2C+but+your+server+cannot+run+SpaceBoard.%3Cul%3E'
   65   104      > FE_RESET_R                                       $47     !0, ->110
        105    > > FE_FETCH_R                                               $47, !1, ->110
   66   106    >   NOP                                                      
        107        FAST_CONCAT                                      ~48     '%3Cli%3E', !1
        108        ECHO                                                     ~48
   65   109      > JMP                                                      ->105
        110    >   FE_FREE                                                  $47
   68   111        ECHO                                                     '%3C%2Ful%3E%3Cp%3EOr%2C+if+you+really+want+to+continue+you+may+'
   69   112        ECHO                                                     '%3Ca+href%3D%22%3Fignore_errors%3D1%22%3Econtinue%3C%2Fa%3E.+You+have+been+warned+'
   70   113        ECHO                                                     'through.+Don%27t+complain+if+your+installation+won%27t+work.%3C%2Fdiv%3E'
   71   114      > EXIT                                                     
   76   115    >   INIT_FCALL                                               'chdir'
        116        SEND_VAL                                                 '..'
        117        DO_ICALL                                                 
   78   118        INCLUDE_OR_EVAL                                          'lib%2Fbasics.php', REQUIRE_ONCE
   79   119        INCLUDE_OR_EVAL                                          'lib%2Ftwig.php', REQUIRE_ONCE
   80   120        INCLUDE_OR_EVAL                                          'lib%2Fi18n.php', REQUIRE_ONCE
   81   121        INCLUDE_OR_EVAL                                          'lib%2Ffunctions.php', REQUIRE_ONCE
   82   122        INCLUDE_OR_EVAL                                          'lib%2Fsql.php', REQUIRE_ONCE
   85   123        ASSIGN                                                   !1, null
   88   124        ASSIGN                                                   !2, 'spaceboard'
   90   125        ASSIGN                                                   !3, 'en'
   95   126        INIT_FCALL_BY_NAME                                       '__'
        127        SEND_VAL_EX                                              'install_server'
        128        DO_FCALL                                      0  $58     
        129        INIT_ARRAY                                       ~59     $58, 'name'
   96   130        INIT_FCALL_BY_NAME                                       '__'
        131        SEND_VAL_EX                                              'install_server_hint'
        132        DO_FCALL                                      0  $60     
        133        ADD_ARRAY_ELEMENT                                ~59     $60, 'hint'
   97   134        ADD_ARRAY_ELEMENT                                ~59     'text', 'type'
   98   135        INIT_FCALL_BY_NAME                                       'issetor'
        136        CHECK_FUNC_ARG                                           
        137        FETCH_FUNC_ARG               global              $61     '_POST'
        138        FETCH_DIM_FUNC_ARG                               $62     $61, 'dbserver'
        139        SEND_FUNC_ARG                                            $62
        140        SEND_VAL_EX                                              'localhost'
        141        DO_FCALL                                      0  $63     
        142        ADD_ARRAY_ELEMENT                                ~59     $63, 'value'
        143        INIT_ARRAY                                       ~64     ~59, 'dbserver'
  101   144        INIT_FCALL_BY_NAME                                       '__'
        145        SEND_VAL_EX                                              'install_name'
        146        DO_FCALL                                      0  $65     
        147        INIT_ARRAY                                       ~66     $65, 'name'
  102   148        ADD_ARRAY_ELEMENT                                ~66     'text', 'type'
  103   149        INIT_FCALL_BY_NAME                                       'issetor'
        150        CHECK_FUNC_ARG                                           
        151        FETCH_FUNC_ARG               global              $67     '_POST'
        152        FETCH_DIM_FUNC_ARG                               $68     $67, 'dbname'
        153        SEND_FUNC_ARG                                            $68
        154        SEND_VAL_EX                                              ''
        155        DO_FCALL                                      0  $69     
        156        ADD_ARRAY_ELEMENT                                ~66     $69, 'value'
        157        ADD_ARRAY_ELEMENT                                ~64     ~66, 'dbname'
  106   158        INIT_FCALL_BY_NAME                                       '__'
        159        SEND_VAL_EX                                              'install_user'
        160        DO_FCALL                                      0  $70     
        161        INIT_ARRAY                                       ~71     $70, 'name'
  107   162        ADD_ARRAY_ELEMENT                                ~71     'text', 'type'
  108   163        INIT_FCALL_BY_NAME                                       'issetor'
        164        CHECK_FUNC_ARG                                           
        165        FETCH_FUNC_ARG               global              $72     '_POST'
        166        FETCH_DIM_FUNC_ARG                               $73     $72, 'dbuser'
        167        SEND_FUNC_ARG                                            $73
        168        SEND_VAL_EX                                              ''
        169        DO_FCALL                                      0  $74     
        170        ADD_ARRAY_ELEMENT                                ~71     $74, 'value'
        171        ADD_ARRAY_ELEMENT                                ~64     ~71, 'dbuser'
  111   172        INIT_FCALL_BY_NAME                                       '__'
        173        SEND_VAL_EX                                              'install_password'
        174        DO_FCALL                                      0  $75     
        175        INIT_ARRAY                                       ~76     $75, 'name'
  112   176        ADD_ARRAY_ELEMENT                                ~76     'password', 'type'
  113   177        INIT_FCALL_BY_NAME                                       'issetor'
        178        CHECK_FUNC_ARG                                           
        179        FETCH_FUNC_ARG               global              $77     '_POST'
        180        FETCH_DIM_FUNC_ARG                               $78     $77, 'dbpass'
        181        SEND_FUNC_ARG                                            $78
        182        SEND_VAL_EX                                              ''
        183        DO_FCALL                                      0  $79     
        184        ADD_ARRAY_ELEMENT                                ~76     $79, 'value'
        185        ADD_ARRAY_ELEMENT                                ~64     ~76, 'dbpass'
  116   186        INIT_FCALL_BY_NAME                                       '__'
        187        SEND_VAL_EX                                              'install_prefix'
        188        DO_FCALL                                      0  $80     
        189        INIT_ARRAY                                       ~81     $80, 'name'
  117   190        INIT_FCALL_BY_NAME                                       '__'
        191        SEND_VAL_EX                                              'install_prefix_hint'
        192        DO_FCALL                                      0  $82     
        193        ADD_ARRAY_ELEMENT                                ~81     $82, 'hint'
  118   194        ADD_ARRAY_ELEMENT                                ~81     'text', 'type'
  119   195        INIT_FCALL_BY_NAME                                       'issetor'
        196        CHECK_FUNC_ARG                                           
        197        FETCH_FUNC_ARG               global              $83     '_POST'
        198        FETCH_DIM_FUNC_ARG                               $84     $83, 'dbprefix'
        199        SEND_FUNC_ARG                                            $84
        200        SEND_VAL_EX                                              'space_'
        201        DO_FCALL                                      0  $85     
        202        ADD_ARRAY_ELEMENT                                ~81     $85, 'value'
        203        ADD_ARRAY_ELEMENT                                ~64     ~81, 'dbprefix'
  122   204        INIT_FCALL_BY_NAME                                       '__'
        205        SEND_VAL_EX                                              'install_port'
        206        DO_FCALL                                      0  $86     
        207        INIT_ARRAY                                       ~87     $86, 'name'
  123   208        INIT_FCALL_BY_NAME                                       '__'
        209        SEND_VAL_EX                                              'install_port_hint'
        210        DO_FCALL                                      0  $88     
        211        ADD_ARRAY_ELEMENT                                ~87     $88, 'hint'
  124   212        ADD_ARRAY_ELEMENT                                ~87     'number', 'type'
  125   213        INIT_FCALL_BY_NAME                                       'issetor'
        214        CHECK_FUNC_ARG                                           
        215        FETCH_FUNC_ARG               global              $89     '_POST'
        216        FETCH_DIM_FUNC_ARG                               $90     $89, 'dbport'
        217        SEND_FUNC_ARG                                            $90
        218        SEND_VAL_EX                                              3306
        219        DO_FCALL                                      0  $91     
        220        ADD_ARRAY_ELEMENT                                ~87     $91, 'value'
        221        ADD_ARRAY_ELEMENT                                ~64     ~87, 'dbport'
  128   222        INIT_FCALL_BY_NAME                                       '__'
        223        SEND_VAL_EX                                              'install_submit'
        224        DO_FCALL                                      0  $92     
        225        INIT_ARRAY                                       ~93     $92, 'name'
  129   226        ADD_ARRAY_ELEMENT                                ~93     'submit', 'type'
  130   227        INIT_FCALL_BY_NAME                                       '__'
        228        SEND_VAL_EX                                              'install_submit_button'
        229        DO_FCALL                                      0  $94     
        230        ADD_ARRAY_ELEMENT                                ~93     $94, 'value'
        231        ADD_ARRAY_ELEMENT                                ~64     ~93, 'submit'
   93   232        ASSIGN                                                   !4, ~64
  132   233      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.53 ms | 1421 KiB | 31 Q