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 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 47) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 88
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 95
Branch analysis from position: 93
2 jumps found. (Code = 46) Position 1 = 96, Position 2 = 99
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 117
Branch analysis from position: 100
2 jumps found. (Code = 77) Position 1 = 107, Position 2 = 112
Branch analysis from position: 107
2 jumps found. (Code = 78) Position 1 = 108, Position 2 = 112
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
Branch analysis from position: 112
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 112
Branch analysis from position: 117
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 99
Branch analysis from position: 95
Branch analysis from position: 88
Branch analysis from position: 63
Branch analysis from position: 57
Branch analysis from position: 50
Branch analysis from position: 43
Branch analysis from position: 36
Branch analysis from position: 28
Branch analysis from position: 16
filename:       /in/ADLFZ
function name:  (null)
number of ops:  236
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    >   BEGIN_SILENCE                                    ~6      
          6        INIT_FCALL                                               'session_start'
          7        DO_ICALL                                                 
          8        END_SILENCE                                              ~6
   13     9        FETCH_IS                                         ~8      '_GET'
         10        ISSET_ISEMPTY_DIM_OBJ                         1  ~9      ~8, 'ignore_errors'
         11        BOOL_NOT                                         ~10     ~9
         12      > JMPZ                                                     ~10, ->16
   14    13    >   FETCH_W                      global              $11     '_SESSION'
         14        ASSIGN_DIM                                               $11, 'space_ignore_errors'
         15        OP_DATA                                                  <true>
   17    16    >   ASSIGN                                                   !0, <array>
   20    17        INIT_FCALL                                               'function_exists'
         18        SEND_VAL                                                 'version_compare'
         19        DO_ICALL                                         $14     
         20        BOOL_NOT                                         ~15     $14
         21      > JMPNZ_EX                                         ~15     ~15, ->28
   21    22    >   INIT_FCALL                                               'version_compare'
         23        SEND_VAL                                                 '8.0.0'
         24        SEND_VAL                                                 '5.2.4'
         25        SEND_VAL                                                 '%3C'
         26        DO_ICALL                                         $16     
         27        BOOL                                             ~15     $16
         28    > > JMPZ                                                     ~15, ->36
   23    29    >   INIT_FCALL                                               'htmlspecialchars'
         30        SEND_VAL                                                 '8.0.0'
         31        DO_ICALL                                         $18     
         32        CONCAT                                           ~19     'You%27re+using+PHP+', $18
   24    33        CONCAT                                           ~20     ~19, '+but+you+need+at+least+PHP+5.2.4'
   23    34        ASSIGN_DIM                                               !0
   24    35        OP_DATA                                                  ~20
   26    36    >   INIT_FCALL                                               'class_exists'
         37        SEND_VAL                                                 'mysqli'
         38        DO_ICALL                                         $21     
         39        BOOL_NOT                                         ~22     $21
         40      > JMPZ                                                     ~22, ->43
   27    41    >   ASSIGN_DIM                                               !0
         42        OP_DATA                                                  '%3Ccode%3Emysqli%3C%2Fcode%3E+not+found%2C+but+it%27s+required.'
   29    43    >   INIT_FCALL                                               'function_exists'
         44        SEND_VAL                                                 'mb_strlen'
         45        DO_ICALL                                         $24     
         46        BOOL_NOT                                         ~25     $24
         47      > JMPZ                                                     ~25, ->50
   30    48    >   ASSIGN_DIM                                               !0
         49        OP_DATA                                                  'Multibyte+String+for+PHP+is+not+installed.+It%27s+required.'
   32    50    >   INIT_FCALL                                               'function_exists'
         51        SEND_VAL                                                 'preg_match'
         52        DO_ICALL                                         $27     
         53        BOOL_NOT                                         ~28     $27
         54      > JMPZ                                                     ~28, ->57
   33    55    >   ASSIGN_DIM                                               !0
   34    56        OP_DATA                                                  'Your+PHP+installation+doesn%27t+have+PCRE.+It%27s+required+for+SpaceBoard+to+work.'
   36    57    >   INIT_FCALL                                               'ini_get'
         58        SEND_VAL                                                 'register_globals'
         59        DO_ICALL                                         $30     
         60      > JMPZ                                                     $30, ->63
   37    61    >   ASSIGN_DIM                                               !0
   40    62        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    63    >   INIT_FCALL                                               'file_exists'
         64        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         65        DO_ICALL                                         $32     
         66        BOOL_NOT                                         ~33     $32
         67      > JMPZ                                                     ~33, ->88
   45    68    >   BEGIN_SILENCE                                    ~34     
         69        INIT_FCALL                                               'mkdir'
         70        SEND_VAL                                                 '..%2Fstorage'
         71        DO_ICALL                                                 
         72        END_SILENCE                                              ~34
   46    73        BEGIN_SILENCE                                    ~36     
         74        INIT_FCALL                                               'mkdir'
         75        SEND_VAL                                                 '..%2Fstorage%2F3rdparty'
         76        DO_ICALL                                                 
         77        END_SILENCE                                              ~36
   47    78        BEGIN_SILENCE                                    ~38     
         79        INIT_FCALL                                               'mkdir'
         80        SEND_VAL                                                 '..%2Fstorage%2F3rdparty%2Ftwig'
         81        DO_ICALL                                                 
         82        END_SILENCE                                              ~38
   48    83        BEGIN_SILENCE                                    ~40     
         84        INIT_FCALL                                               'mkdir'
         85        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         86        DO_ICALL                                                 
         87        END_SILENCE                                              ~40
   52    88    >   INIT_FCALL                                               'file_exists'
         89        SEND_VAL                                                 '..%2Fstorage%2Fplugins'
         90        DO_ICALL                                         $42     
         91        BOOL_NOT                                         ~43     $42
         92      > JMPZ                                                     ~43, ->95
   53    93    >   ASSIGN_DIM                                               !0
   55    94        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    95    > > JMPZ_EX                                          ~45     !0, ->99
         96    >   FETCH_IS                                         ~46     '_SESSION'
         97        ISSET_ISEMPTY_DIM_OBJ                         1  ~47     ~46, 'space_ignore_errors'
         98        BOOL                                             ~45     ~47
         99    > > JMPZ                                                     ~45, ->117
   59   100    >   ECHO                                                     '%3C%21DOCTYPE+html%3E%3Ctitle%3ERuntime+error%21%3C%2Ftitle%3E'
   60   101        ECHO                                                     '%3Cdiv+style%3D%22border-top%3A+5px+solid+red%3B'
   61   102        ECHO                                                     'border-bottom%3A+5px+solid+red%3B'
   62   103        ECHO                                                     'background%3A+%23FEE%3B'
   63   104        ECHO                                                     'padding%3A+5px%22%3E'
   64   105        ECHO                                                     '%3Cp%3ESorry%2C+but+your+server+cannot+run+SpaceBoard.%3Cul%3E'
   65   106      > FE_RESET_R                                       $48     !0, ->112
        107    > > FE_FETCH_R                                               $48, !1, ->112
   66   108    >   NOP                                                      
        109        FAST_CONCAT                                      ~49     '%3Cli%3E', !1
        110        ECHO                                                     ~49
   65   111      > JMP                                                      ->107
        112    >   FE_FREE                                                  $48
   68   113        ECHO                                                     '%3C%2Ful%3E%3Cp%3EOr%2C+if+you+really+want+to+continue+you+may+'
   69   114        ECHO                                                     '%3Ca+href%3D%22%3Fignore_errors%3D1%22%3Econtinue%3C%2Fa%3E.+You+have+been+warned+'
   70   115        ECHO                                                     'through.+Don%27t+complain+if+your+installation+won%27t+work.%3C%2Fdiv%3E'
   71   116      > EXIT                                                     
   76   117    >   INIT_FCALL                                               'chdir'
        118        SEND_VAL                                                 '..'
        119        DO_ICALL                                                 
   78   120        INCLUDE_OR_EVAL                                          'lib%2Fbasics.php', REQUIRE_ONCE
   79   121        INCLUDE_OR_EVAL                                          'lib%2Ftwig.php', REQUIRE_ONCE
   80   122        INCLUDE_OR_EVAL                                          'lib%2Fi18n.php', REQUIRE_ONCE
   81   123        INCLUDE_OR_EVAL                                          'lib%2Ffunctions.php', REQUIRE_ONCE
   82   124        INCLUDE_OR_EVAL                                          'lib%2Fsql.php', REQUIRE_ONCE
   85   125        ASSIGN                                                   !1, null
   88   126        ASSIGN                                                   !2, 'spaceboard'
   90   127        ASSIGN                                                   !3, 'en'
   95   128        INIT_FCALL_BY_NAME                                       '__'
        129        SEND_VAL_EX                                              'install_server'
        130        DO_FCALL                                      0  $59     
        131        INIT_ARRAY                                       ~60     $59, 'name'
   96   132        INIT_FCALL_BY_NAME                                       '__'
        133        SEND_VAL_EX                                              'install_server_hint'
        134        DO_FCALL                                      0  $61     
        135        ADD_ARRAY_ELEMENT                                ~60     $61, 'hint'
   97   136        ADD_ARRAY_ELEMENT                                ~60     'text', 'type'
   98   137        INIT_FCALL_BY_NAME                                       'issetor'
        138        CHECK_FUNC_ARG                                           
        139        FETCH_FUNC_ARG               global              $62     '_POST'
        140        FETCH_DIM_FUNC_ARG                               $63     $62, 'dbserver'
        141        SEND_FUNC_ARG                                            $63
        142        SEND_VAL_EX                                              'localhost'
        143        DO_FCALL                                      0  $64     
        144        ADD_ARRAY_ELEMENT                                ~60     $64, 'value'
        145        INIT_ARRAY                                       ~65     ~60, 'dbserver'
  101   146        INIT_FCALL_BY_NAME                                       '__'
        147        SEND_VAL_EX                                              'install_name'
        148        DO_FCALL                                      0  $66     
        149        INIT_ARRAY                                       ~67     $66, 'name'
  102   150        ADD_ARRAY_ELEMENT                                ~67     'text', 'type'
  103   151        INIT_FCALL_BY_NAME                                       'issetor'
        152        CHECK_FUNC_ARG                                           
        153        FETCH_FUNC_ARG               global              $68     '_POST'
        154        FETCH_DIM_FUNC_ARG                               $69     $68, 'dbname'
        155        SEND_FUNC_ARG                                            $69
        156        SEND_VAL_EX                                              ''
        157        DO_FCALL                                      0  $70     
        158        ADD_ARRAY_ELEMENT                                ~67     $70, 'value'
        159        ADD_ARRAY_ELEMENT                                ~65     ~67, 'dbname'
  106   160        INIT_FCALL_BY_NAME                                       '__'
        161        SEND_VAL_EX                                              'install_user'
        162        DO_FCALL                                      0  $71     
        163        INIT_ARRAY                                       ~72     $71, 'name'
  107   164        ADD_ARRAY_ELEMENT                                ~72     'text', 'type'
  108   165        INIT_FCALL_BY_NAME                                       'issetor'
        166        CHECK_FUNC_ARG                                           
        167        FETCH_FUNC_ARG               global              $73     '_POST'
        168        FETCH_DIM_FUNC_ARG                               $74     $73, 'dbuser'
        169        SEND_FUNC_ARG                                            $74
        170        SEND_VAL_EX                                              ''
        171        DO_FCALL                                      0  $75     
        172        ADD_ARRAY_ELEMENT                                ~72     $75, 'value'
        173        ADD_ARRAY_ELEMENT                                ~65     ~72, 'dbuser'
  111   174        INIT_FCALL_BY_NAME                                       '__'
        175        SEND_VAL_EX                                              'install_password'
        176        DO_FCALL                                      0  $76     
        177        INIT_ARRAY                                       ~77     $76, 'name'
  112   178        ADD_ARRAY_ELEMENT                                ~77     'password', 'type'
  113   179        INIT_FCALL_BY_NAME                                       'issetor'
        180        CHECK_FUNC_ARG                                           
        181        FETCH_FUNC_ARG               global              $78     '_POST'
        182        FETCH_DIM_FUNC_ARG                               $79     $78, 'dbpass'
        183        SEND_FUNC_ARG                                            $79
        184        SEND_VAL_EX                                              ''
        185        DO_FCALL                                      0  $80     
        186        ADD_ARRAY_ELEMENT                                ~77     $80, 'value'
        187        ADD_ARRAY_ELEMENT                                ~65     ~77, 'dbpass'
  116   188        INIT_FCALL_BY_NAME                                       '__'
        189        SEND_VAL_EX                                              'install_prefix'
        190        DO_FCALL                                      0  $81     
        191        INIT_ARRAY                                       ~82     $81, 'name'
  117   192        INIT_FCALL_BY_NAME                                       '__'
        193        SEND_VAL_EX                                              'install_prefix_hint'
        194        DO_FCALL                                      0  $83     
        195        ADD_ARRAY_ELEMENT                                ~82     $83, 'hint'
  118   196        ADD_ARRAY_ELEMENT                                ~82     'text', 'type'
  119   197        INIT_FCALL_BY_NAME                                       'issetor'
        198        CHECK_FUNC_ARG                                           
        199        FETCH_FUNC_ARG               global              $84     '_POST'
        200        FETCH_DIM_FUNC_ARG                               $85     $84, 'dbprefix'
        201        SEND_FUNC_ARG                                            $85
        202        SEND_VAL_EX                                              'space_'
        203        DO_FCALL                                      0  $86     
        204        ADD_ARRAY_ELEMENT                                ~82     $86, 'value'
        205        ADD_ARRAY_ELEMENT                                ~65     ~82, 'dbprefix'
  122   206        INIT_FCALL_BY_NAME                                       '__'
        207        SEND_VAL_EX                                              'install_port'
        208        DO_FCALL                                      0  $87     
        209        INIT_ARRAY                                       ~88     $87, 'name'
  123   210        INIT_FCALL_BY_NAME                                       '__'
        211        SEND_VAL_EX                                              'install_port_hint'
        212        DO_FCALL                                      0  $89     
        213        ADD_ARRAY_ELEMENT                                ~88     $89, 'hint'
  124   214        ADD_ARRAY_ELEMENT                                ~88     'number', 'type'
  125   215        INIT_FCALL_BY_NAME                                       'issetor'
        216        CHECK_FUNC_ARG                                           
        217        FETCH_FUNC_ARG               global              $90     '_POST'
        218        FETCH_DIM_FUNC_ARG                               $91     $90, 'dbport'
        219        SEND_FUNC_ARG                                            $91
        220        SEND_VAL_EX                                              3306
        221        DO_FCALL                                      0  $92     
        222        ADD_ARRAY_ELEMENT                                ~88     $92, 'value'
        223        ADD_ARRAY_ELEMENT                                ~65     ~88, 'dbport'
  128   224        INIT_FCALL_BY_NAME                                       '__'
        225        SEND_VAL_EX                                              'install_submit'
        226        DO_FCALL                                      0  $93     
        227        INIT_ARRAY                                       ~94     $93, 'name'
  129   228        ADD_ARRAY_ELEMENT                                ~94     'submit', 'type'
  130   229        INIT_FCALL_BY_NAME                                       '__'
        230        SEND_VAL_EX                                              'install_submit_button'
        231        DO_FCALL                                      0  $95     
        232        ADD_ARRAY_ELEMENT                                ~94     $95, 'value'
        233        ADD_ARRAY_ELEMENT                                ~65     ~94, 'submit'
   93   234        ASSIGN                                                   !4, ~65
  132   235      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.33 ms | 1416 KiB | 31 Q