3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); $errorLoggingType = 3; // writeErrorLog sends output to a file in the storage folder (default behavior) //$errorLoggingType = 0; // writeErrorLog sends output to the server log set_include_path( $scriptpath . PATH_SEPARATOR . get_include_path() ); // get the S-Drive configuration if it exists @include_once 'SdriveConfig.php'; // initialize the singleton with the form-name // the global $myPage is used in older code, don't remove it! $myPage = FormPage::GetInstance( $myName ); if( isset( $sdrive_config ) ) { $errorLoggingType = 0; // better send writeErrorLog output to the server log // $myPage->sdrive is initialized to false Config::GetInstance()->LoadConfig( $sdrive_config ); if( isset( $sdrive_model ) ) Config::GetInstance()->sdrive_model = $sdrive_model; // on S-Drive the cart scripts are taken directly from the resources $buildnum = Config::GetInstance()->GetConfig( 'resource_version' ); if( ! $buildnum ) writeErrorLog( 'Parameter missing or empty in form.cfg.dat', 'resource_version' ); $cartpath = CC_HOSTING_RESOURCES . DIRECTORY_SEPARATOR .'FB' . DIRECTORY_SEPARATOR . $buildnum . DIRECTORY_SEPARATOR . 'fb'; set_include_path( get_include_path() . PATH_SEPARATOR . $cartpath ); // add this constant to the file names to include instead of adding it to the include path // as a type of name spacing define( 'CARTREVISION', 'cartapp' ); } else { // A version number is added to the folder name for forward compatibility. FB increments this // number if changes are NOT backward compatible. FB must also create the corrresponding // folder (leaving the old folder for forms made and uploaded with a previous version). define( 'CARTREVISION', 'cartapp_v1' ); Config::GetInstance()->LoadConfig(); } // catch warnings with our own error handler to ignore them as appropriate set_error_handler( 'myErrorHandler', E_WARNING ) ; /*** end of global config ***/ /*********** utility functions ************/ // define our auto-loader for classes function myOwnAutoload($class_name) { global $scriptpath; include $scriptpath . '/fbapp/php/' . strtolower( $class_name ) . '.cls.php'; } spl_autoload_register('myOwnAutoload'); // shows warning more user-friendly function myErrorHandler( $errno, $errstr, $errfile, $errline ) { // some fopen() may fail because the files are optional if( strpos( $errstr, 'fopen') !== false ) return false; $page = FormPage::GetInstance(); // the rules may contain an invalid regexp if( strpos( $errstr, 'preg_match' ) !== false && strpos( $errfile, 'validator.inc.php' ) !== false ) { $msg = _T('Error validating RegEx magic field') . substr( $errstr , strrpos( $errstr, ':') ); } else { // default message $msg = 'Warning: [ err ' . $errno . '/line '. $errline . substr( $errfile, strrpos( $errfile, '/' ) ) . '] ' . $errstr; } if( $page ) { $page->SetErrors( array( array( 'warn' => $msg ) ) ); } else { $errors = array( 'warn' => $msg ); include 'fbapp/inc/displayerrors.inc.php'; exit(0); } return true; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 65
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 45
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 33
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4pLCj
function name:  (null)
number of ops:  81
compiled vars:  !0 = $errorLoggingType, !1 = $scriptpath, !2 = $myPage, !3 = $myName, !4 = $sdrive_config, !5 = $sdrive_model, !6 = $buildnum, !7 = $cartpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 22519
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, 3
    7     4        INIT_FCALL                                               'set_include_path'
          5        CONCAT                                           ~10     !1, '%3A'
          6        INIT_FCALL                                               'get_include_path'
          7        DO_ICALL                                         $11     
          8        CONCAT                                           ~12     ~10, $11
          9        SEND_VAL                                                 ~12
         10        DO_ICALL                                                 
   10    11        BEGIN_SILENCE                                    ~14     
         12        INCLUDE_OR_EVAL                                          'SdriveConfig.php', INCLUDE_ONCE
         13        END_SILENCE                                              ~14
   15    14        INIT_STATIC_METHOD_CALL                                  'FormPage', 'GetInstance'
         15        SEND_VAR_EX                                              !3
         16        DO_FCALL                                      0  $16     
         17        ASSIGN                                                   !2, $16
   17    18        ISSET_ISEMPTY_CV                                         !4
         19      > JMPZ                                                     ~18, ->65
   19    20    >   ASSIGN                                                   !0, 0
   22    21        INIT_STATIC_METHOD_CALL                                  'Config', 'GetInstance'
         22        DO_FCALL                                      0  $20     
         23        INIT_METHOD_CALL                                         $20, 'LoadConfig'
         24        SEND_VAR_EX                                              !4
         25        DO_FCALL                                      0          
   24    26        ISSET_ISEMPTY_CV                                         !5
         27      > JMPZ                                                     ~22, ->33
   25    28    >   INIT_STATIC_METHOD_CALL                                  'Config', 'GetInstance'
         29        DO_FCALL                                      0  $23     
         30        SEPARATE                                         $23     $23
         31        ASSIGN_OBJ                                               $23, 'sdrive_model'
         32        OP_DATA                                                  !5
   28    33    >   INIT_STATIC_METHOD_CALL                                  'Config', 'GetInstance'
         34        DO_FCALL                                      0  $25     
         35        INIT_METHOD_CALL                                         $25, 'GetConfig'
         36        SEND_VAL_EX                                              'resource_version'
         37        DO_FCALL                                      0  $26     
         38        ASSIGN                                                   !6, $26
   29    39        BOOL_NOT                                         ~28     !6
         40      > JMPZ                                                     ~28, ->45
         41    >   INIT_FCALL_BY_NAME                                       'writeErrorLog'
         42        SEND_VAL_EX                                              'Parameter+missing+or+empty+in+form.cfg.dat'
         43        SEND_VAL_EX                                              'resource_version'
         44        DO_FCALL                                      0          
   30    45    >   FETCH_CONSTANT                                   ~30     'CC_HOSTING_RESOURCES'
         46        CONCAT                                           ~31     ~30, '%2F'
         47        CONCAT                                           ~32     ~31, 'FB'
         48        CONCAT                                           ~33     ~32, '%2F'
         49        CONCAT                                           ~34     ~33, !6
         50        CONCAT                                           ~35     ~34, '%2F'
         51        CONCAT                                           ~36     ~35, 'fb'
         52        ASSIGN                                                   !7, ~36
   32    53        INIT_FCALL                                               'set_include_path'
         54        INIT_FCALL                                               'get_include_path'
         55        DO_ICALL                                         $38     
         56        CONCAT                                           ~39     $38, '%3A'
         57        CONCAT                                           ~40     ~39, !7
         58        SEND_VAL                                                 ~40
         59        DO_ICALL                                                 
   36    60        INIT_FCALL                                               'define'
         61        SEND_VAL                                                 'CARTREVISION'
         62        SEND_VAL                                                 'cartapp'
         63        DO_ICALL                                                 
   17    64      > JMP                                                      ->73
   43    65    >   INIT_FCALL                                               'define'
         66        SEND_VAL                                                 'CARTREVISION'
         67        SEND_VAL                                                 'cartapp_v1'
         68        DO_ICALL                                                 
   44    69        INIT_STATIC_METHOD_CALL                                  'Config', 'GetInstance'
         70        DO_FCALL                                      0  $44     
         71        INIT_METHOD_CALL                                         $44, 'LoadConfig'
         72        DO_FCALL                                      0          
   50    73    >   INIT_FCALL                                               'set_error_handler'
         74        SEND_VAL                                                 'myErrorHandler'
         75        SEND_VAL                                                 2
         76        DO_ICALL                                                 
   70    77        INIT_FCALL                                               'spl_autoload_register'
         78        SEND_VAL                                                 'myOwnAutoload'
         79        DO_ICALL                                                 
  104    80      > RETURN                                                   1

Function myownautoload:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4pLCj
function name:  myOwnAutoload
number of ops:  10
compiled vars:  !0 = $class_name, !1 = $scriptpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   RECV                                             !0      
   66     1        BIND_GLOBAL                                              !1, 'scriptpath'
   67     2        CONCAT                                           ~2      !1, '%2Ffbapp%2Fphp%2F'
          3        INIT_FCALL                                               'strtolower'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        CONCAT                                           ~4      ~2, $3
          7        CONCAT                                           ~5      ~4, '.cls.php'
          8        INCLUDE_OR_EVAL                                          ~5, INCLUDE
   68     9      > RETURN                                                   null

End of function myownautoload

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 41
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 63
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 63
Branch analysis from position: 57
Branch analysis from position: 63
Branch analysis from position: 26
filename:       /in/4pLCj
function name:  myErrorHandler
number of ops:  69
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $page, !5 = $msg, !6 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   74     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   77     4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 'fopen'
          7        DO_ICALL                                         $7      
          8        TYPE_CHECK                                  1018          $7
          9      > JMPZ                                                     ~8, ->11
         10    > > RETURN                                                   <false>
   79    11    >   INIT_STATIC_METHOD_CALL                                  'FormPage', 'GetInstance'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !4, $9
   82    14        INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 'preg_match'
         17        DO_ICALL                                         $11     
         18        TYPE_CHECK                                  1018  ~12     $11
         19      > JMPZ_EX                                          ~12     ~12, ->26
   83    20    >   INIT_FCALL                                               'strpos'
         21        SEND_VAR                                                 !2
         22        SEND_VAL                                                 'validator.inc.php'
         23        DO_ICALL                                         $13     
         24        TYPE_CHECK                                  1018  ~14     $13
         25        BOOL                                             ~12     ~14
         26    > > JMPZ                                                     ~12, ->41
   85    27    >   INIT_FCALL_BY_NAME                                       '_T'
         28        SEND_VAL_EX                                              'Error+validating+RegEx+magic+field'
         29        DO_FCALL                                      0  $15     
         30        INIT_FCALL                                               'substr'
         31        SEND_VAR                                                 !1
         32        INIT_FCALL                                               'strrpos'
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 '%3A'
         35        DO_ICALL                                         $16     
         36        SEND_VAR                                                 $16
         37        DO_ICALL                                         $17     
         38        CONCAT                                           ~18     $15, $17
         39        ASSIGN                                                   !5, ~18
   82    40      > JMP                                                      ->56
   90    41    >   CONCAT                                           ~20     'Warning%3A+%5B+err+', !0
         42        CONCAT                                           ~21     ~20, '%2Fline+'
         43        CONCAT                                           ~22     ~21, !3
         44        INIT_FCALL                                               'substr'
         45        SEND_VAR                                                 !2
         46        INIT_FCALL                                               'strrpos'
         47        SEND_VAR                                                 !2
         48        SEND_VAL                                                 '%2F'
         49        DO_ICALL                                         $23     
         50        SEND_VAR                                                 $23
         51        DO_ICALL                                         $24     
         52        CONCAT                                           ~25     ~22, $24
         53        CONCAT                                           ~26     ~25, '%5D+'
         54        CONCAT                                           ~27     ~26, !1
         55        ASSIGN                                                   !5, ~27
   93    56    > > JMPZ                                                     !4, ->63
   94    57    >   INIT_METHOD_CALL                                         !4, 'SetErrors'
         58        INIT_ARRAY                                       ~29     !5, 'warn'
         59        INIT_ARRAY                                       ~30     ~29
         60        SEND_VAL_EX                                              ~30
         61        DO_FCALL                                      0          
   93    62      > JMP                                                      ->67
   96    63    >   INIT_ARRAY                                       ~32     !5, 'warn'
         64        ASSIGN                                                   !6, ~32
   97    65        INCLUDE_OR_EVAL                                          'fbapp%2Finc%2Fdisplayerrors.inc.php', INCLUDE
   98    66      > EXIT                                                     0
  101    67    > > RETURN                                                   <true>
  102    68*     > RETURN                                                   null

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
223.37 ms | 1029 KiB | 23 Q