3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Form_Prepare { public static function Standard($table, $location = 'create') { $schema = GetDBSchema(); $xtable = $schema->el('//table[name="' . $table . '"]'); foreach( $xtable->xpath('./columns/column') as $xcolumn ) { $xlocation = $xcolumn->el('./user/' . $location); if( empty($xlocation) || !$xlocation->val() ) { if( isset($_REQUEST[$xcolumn->name->val()]) ) { unset($_REQUEST[$xcolumn->name->val()]); } } } } public static function Custom($table, $allow_field = 'on_submit') { $DB = GetDB(); $result = $DB->Query('SELECT * FROM #', array($table)); while( $field = $DB->NextRow($result) ) { // User can submit this field if( $field[$allow_field] ) { if( $field['type'] == Form_Field::CHECKBOX && !isset($_REQUEST[$field['name']]) ) { $_REQUEST[$field['name']] = 0; } } // User cannot submit this field else { if( isset($_REQUEST[$field['name']]) ) { unset($_REQUEST[$field['name']]); } } } $DB->Free($result); } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vvcoq
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E > > RETURN                                                   1

Class Form_Prepare:
Function standard:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 40
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 40
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 39
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 27
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/Vvcoq
function name:  Standard
number of ops:  42
compiled vars:  !0 = $table, !1 = $location, !2 = $schema, !3 = $xtable, !4 = $xcolumn, !5 = $xlocation
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'create'
    9     2        INIT_FCALL_BY_NAME                                       'GetDBSchema'
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !2, $6
   10     5        INIT_METHOD_CALL                                         !2, 'el'
          6        CONCAT                                           ~8      '%2F%2Ftable%5Bname%3D%22', !0
          7        CONCAT                                           ~9      ~8, '%22%5D'
          8        SEND_VAL_EX                                              ~9
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !3, $10
   12    11        INIT_METHOD_CALL                                         !3, 'xpath'
         12        SEND_VAL_EX                                              '.%2Fcolumns%2Fcolumn'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->40
         15    > > FE_FETCH_R                                               $13, !4, ->40
   14    16    >   INIT_METHOD_CALL                                         !4, 'el'
         17        CONCAT                                           ~14     '.%2Fuser%2F', !1
         18        SEND_VAL_EX                                              ~14
         19        DO_FCALL                                      0  $15     
         20        ASSIGN                                                   !5, $15
   16    21        ISSET_ISEMPTY_CV                                 ~17     !5
         22      > JMPNZ_EX                                         ~17     ~17, ->27
         23    >   INIT_METHOD_CALL                                         !5, 'val'
         24        DO_FCALL                                      0  $18     
         25        BOOL_NOT                                         ~19     $18
         26        BOOL                                             ~17     ~19
         27    > > JMPZ                                                     ~17, ->39
   18    28    >   FETCH_OBJ_R                                      ~21     !4, 'name'
         29        INIT_METHOD_CALL                                         ~21, 'val'
         30        DO_FCALL                                      0  $22     
         31        FETCH_IS                                         ~20     '_REQUEST'
         32        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, $22
         33      > JMPZ                                                     ~23, ->39
   20    34    >   FETCH_OBJ_R                                      ~25     !4, 'name'
         35        INIT_METHOD_CALL                                         ~25, 'val'
         36        DO_FCALL                                      0  $26     
         37        FETCH_UNSET                                      $24     '_REQUEST'
         38        UNSET_DIM                                                $24, $26
   12    39    > > JMP                                                      ->15
         40    >   FE_FREE                                                  $13
   24    41      > RETURN                                                   null

End of function standard

Function custom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 12
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 28
Branch analysis from position: 23
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 12
Branch analysis from position: 41
Branch analysis from position: 12
Branch analysis from position: 36
filename:       /in/Vvcoq
function name:  Custom
number of ops:  45
compiled vars:  !0 = $table, !1 = $allow_field, !2 = $DB, !3 = $result, !4 = $field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'on_submit'
   28     2        INIT_FCALL_BY_NAME                                       'GetDB'
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !2, $5
   30     5        INIT_METHOD_CALL                                         !2, 'Query'
          6        SEND_VAL_EX                                              'SELECT+%2A+FROM+%23'
          7        INIT_ARRAY                                       ~7      !0
          8        SEND_VAL_EX                                              ~7
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !3, $8
   32    11      > JMP                                                      ->36
   35    12    >   FETCH_DIM_R                                      ~10     !4, !1
         13      > JMPZ                                                     ~10, ->29
   37    14    >   FETCH_DIM_R                                      ~11     !4, 'type'
         15        FETCH_CLASS_CONSTANT                             ~12     'Form_Field', 'CHECKBOX'
         16        IS_EQUAL                                         ~13     ~11, ~12
         17      > JMPZ_EX                                          ~13     ~13, ->23
         18    >   FETCH_DIM_R                                      ~15     !4, 'name'
         19        FETCH_IS                                         ~14     '_REQUEST'
         20        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     ~14, ~15
         21        BOOL_NOT                                         ~17     ~16
         22        BOOL                                             ~13     ~17
         23    > > JMPZ                                                     ~13, ->28
   39    24    >   FETCH_DIM_R                                      ~19     !4, 'name'
         25        FETCH_W                      global              $18     '_REQUEST'
         26        ASSIGN_DIM                                               $18, ~19
         27        OP_DATA                                                  0
         28    > > JMP                                                      ->36
   46    29    >   FETCH_DIM_R                                      ~22     !4, 'name'
         30        FETCH_IS                                         ~21     '_REQUEST'
         31        ISSET_ISEMPTY_DIM_OBJ                         0          ~21, ~22
         32      > JMPZ                                                     ~23, ->36
   48    33    >   FETCH_DIM_R                                      ~25     !4, 'name'
         34        FETCH_UNSET                                      $24     '_REQUEST'
         35        UNSET_DIM                                                $24, ~25
   32    36    >   INIT_METHOD_CALL                                         !2, 'NextRow'
         37        SEND_VAR_EX                                              !3
         38        DO_FCALL                                      0  $26     
         39        ASSIGN                                           ~27     !4, $26
         40      > JMPNZ                                                    ~27, ->12
   53    41    >   INIT_METHOD_CALL                                         !2, 'Free'
         42        SEND_VAR_EX                                              !3
         43        DO_FCALL                                      0          
   54    44      > RETURN                                                   null

End of function custom

End of class Form_Prepare.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.5 ms | 1403 KiB | 13 Q