3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://3v4l.org/ // http://sandbox.onlinephpfunctions.com/ function echo_table($arr_validate){ ?><table><?php foreach ($arr_validate as $keyO => $valueO) { ?><tr><?php ?><td><?php echo '<h5>', $keyO, '</h5>'; ?></td><?php ?></tr><?php ?><tr><?php ?><th>FLAG(S)--></th><?php foreach ($arr_validate[$keyO]['flags'] as $keyF => $valueF) { ?><th colspan="1"><?php echo $keyF; ?></th><?php } ?></tr><?php foreach ($arr_validate[$keyO]['values'] as $keyI => $valueI) { ?><tr><?php ?><td><?php echo var_dump($valueI); // echo gettype($valueI); // echo $keyI; foreach ($arr_validate[$keyO]['flags'] as $keyF => $valueF) { ?></td><td><?php $tmp = filter_var($valueI, $arr_validate[$keyO]['id'], $valueF); var_dump($tmp); // if ($tmp === true) { // echo 'true'; // } else if ($tmp === false) { // echo 'false'; // } else if ($tmp === null) { // echo 'null'; // } else { // echo $tmp; // }; // echo gettype($tmp); } ?></td><?php ?></tr><?php } } ?></table><?php } /* @var $this SiteController */ echo 'ini_get(\'filter.default\'): >>'.ini_get('filter.default').'<<, type: '.gettype(ini_get('filter.default')); echo '<br />'; echo 'ini_get(\'filter.default_flags\'): >>'.ini_get('filter.default_flags').'<<, type: '.gettype(ini_get('filter.default_flags')); echo '<br />'; if (ini_get('filter.default_flags') === false) { echo 'ini_get(\'filter.default_flags\'): false'; }; if (ini_get('filter.default_flags') === true) { echo 'ini_get(\'filter.default_flags\'): true'; }; $arr_validate = array( 'FILTER_VALIDATE_BOOLEAN' => array( 'id' => FILTER_VALIDATE_BOOLEAN, 'flags' => array('nothing' => '', 'FILTER_NULL_ON_FAILURE' => FILTER_NULL_ON_FAILURE), 'values' => array('1'=>1, 'true'=>true, '\'1\''=>'1', '\'true\''=>'true', '\'on\''=>'on', '\'yes\''=>'yes', '0'=>0, 'false'=>false, '\'0\''=>'0', '\'false\''=>'false', '\'off\''=>'off', '\'no\''=>'no', '\'\''=>'', 'null'=>null, '\'null\''=>'null', '\'-0\''=>'-0', '\'+0\''=>'+0', '2'=>2, '-1'=>-1), ), 'FILTER_VALIDATE_EMAIL' => array( 'id' => FILTER_VALIDATE_EMAIL, 'flags' => array('nothing' => ''), 'values' => array( '1@1.1', '1@localhost', '1@nemjo', '1nemjo', ) ), 'FILTER_VALIDATE_FLOAT' => array( 'id' => FILTER_VALIDATE_FLOAT, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_INT' => array( 'id' => FILTER_VALIDATE_INT, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_IP' => array( 'id' => FILTER_VALIDATE_IP, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_REGEXP' => array( 'id' => FILTER_VALIDATE_REGEXP, 'flags' => array('nothing' => '', ), 'values' => array(), ), 'FILTER_VALIDATE_URL' => array( 'id' => FILTER_VALIDATE_URL, 'flags' => array('nothing' => '', ), 'values' => array(), ), ); foreach ($arr_validate as $key => $value) { echo_table(array($key => $value)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 45
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 45
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
Branch analysis from position: 36
Branch analysis from position: 30
filename:       /in/BlfuV
function name:  (null)
number of ops:  47
compiled vars:  !0 = $arr_validate, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   INIT_FCALL                                               'ini_get'
          1        SEND_VAL                                                 'filter.default'
          2        DO_ICALL                                         $3      
          3        CONCAT                                           ~4      'ini_get%28%27filter.default%27%29%3A+%3E%3E', $3
          4        CONCAT                                           ~5      ~4, '%3C%3C%2C+type%3A+'
          5        INIT_FCALL                                               'ini_get'
          6        SEND_VAL                                                 'filter.default'
          7        DO_ICALL                                         $6      
          8        GET_TYPE                                         ~7      $6
          9        CONCAT                                           ~8      ~5, ~7
         10        ECHO                                                     ~8
   50    11        ECHO                                                     '%3Cbr+%2F%3E'
   51    12        INIT_FCALL                                               'ini_get'
         13        SEND_VAL                                                 'filter.default_flags'
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     'ini_get%28%27filter.default_flags%27%29%3A+%3E%3E', $9
         16        CONCAT                                           ~11     ~10, '%3C%3C%2C+type%3A+'
         17        INIT_FCALL                                               'ini_get'
         18        SEND_VAL                                                 'filter.default_flags'
         19        DO_ICALL                                         $12     
         20        GET_TYPE                                         ~13     $12
         21        CONCAT                                           ~14     ~11, ~13
         22        ECHO                                                     ~14
   52    23        ECHO                                                     '%3Cbr+%2F%3E'
   53    24        INIT_FCALL                                               'ini_get'
         25        SEND_VAL                                                 'filter.default_flags'
         26        DO_ICALL                                         $15     
         27        TYPE_CHECK                                    4          $15
         28      > JMPZ                                                     ~16, ->30
   54    29    >   ECHO                                                     'ini_get%28%27filter.default_flags%27%29%3A+false'
   56    30    >   INIT_FCALL                                               'ini_get'
         31        SEND_VAL                                                 'filter.default_flags'
         32        DO_ICALL                                         $17     
         33        TYPE_CHECK                                    8          $17
         34      > JMPZ                                                     ~18, ->36
   57    35    >   ECHO                                                     'ini_get%28%27filter.default_flags%27%29%3A+true'
   59    36    >   ASSIGN                                                   !0, <array>
  103    37      > FE_RESET_R                                       $20     !0, ->45
         38    > > FE_FETCH_R                                       ~21     $20, !1, ->45
         39    >   ASSIGN                                                   !2, ~21
  104    40        INIT_FCALL                                               'echo_table'
         41        INIT_ARRAY                                       ~23     !1, !2
         42        SEND_VAL                                                 ~23
         43        DO_FCALL                                      0          
  103    44      > JMP                                                      ->38
         45    >   FE_FREE                                                  $20
  105    46      > RETURN                                                   1

Function echo_table:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 60
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 60
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 58
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 58
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 54
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 54
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 54
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 58
Branch analysis from position: 23
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
filename:       /in/BlfuV
function name:  echo_table
number of ops:  63
compiled vars:  !0 = $arr_validate, !1 = $valueO, !2 = $keyO, !3 = $valueF, !4 = $keyF, !5 = $valueI, !6 = $keyI, !7 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ECHO                                                     '%3Ctable%3E'
    6     2      > FE_RESET_R                                       $8      !0, ->60
          3    > > FE_FETCH_R                                       ~9      $8, !1, ->60
          4    >   ASSIGN                                                   !2, ~9
    7     5        ECHO                                                     '%3Ctr%3E'
    8     6        ECHO                                                     '%3Ctd%3E'
    9     7        ECHO                                                     '%3Ch5%3E'
          8        ECHO                                                     !2
          9        ECHO                                                     '%3C%2Fh5%3E'
   10    10        ECHO                                                     '%3C%2Ftd%3E'
   11    11        ECHO                                                     '%3C%2Ftr%3E'
   12    12        ECHO                                                     '%3Ctr%3E'
   13    13        ECHO                                                     '%3Cth%3EFLAG%28S%29--%3E%3C%2Fth%3E'
   14    14        FETCH_DIM_R                                      ~11     !0, !2
         15        FETCH_DIM_R                                      ~12     ~11, 'flags'
         16      > FE_RESET_R                                       $13     ~12, ->23
         17    > > FE_FETCH_R                                       ~14     $13, !3, ->23
         18    >   ASSIGN                                                   !4, ~14
   15    19        ECHO                                                     '%3Cth+colspan%3D%221%22%3E'
   16    20        ECHO                                                     !4
   17    21        ECHO                                                     '%3C%2Fth%3E'
   14    22      > JMP                                                      ->17
         23    >   FE_FREE                                                  $13
   19    24        ECHO                                                     '%3C%2Ftr%3E'
   20    25        FETCH_DIM_R                                      ~16     !0, !2
         26        FETCH_DIM_R                                      ~17     ~16, 'values'
         27      > FE_RESET_R                                       $18     ~17, ->58
         28    > > FE_FETCH_R                                       ~19     $18, !5, ->58
         29    >   ASSIGN                                                   !6, ~19
   21    30        ECHO                                                     '%3Ctr%3E'
   22    31        ECHO                                                     '%3Ctd%3E'
   23    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !5
         34        DO_ICALL                                         $21     
         35        ECHO                                                     $21
   26    36        FETCH_DIM_R                                      ~22     !0, !2
         37        FETCH_DIM_R                                      ~23     ~22, 'flags'
         38      > FE_RESET_R                                       $24     ~23, ->54
         39    > > FE_FETCH_R                                       ~25     $24, !3, ->54
         40    >   ASSIGN                                                   !4, ~25
   27    41        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   28    42        INIT_FCALL                                               'filter_var'
         43        SEND_VAR                                                 !5
         44        FETCH_DIM_R                                      ~27     !0, !2
         45        FETCH_DIM_R                                      ~28     ~27, 'id'
         46        SEND_VAL                                                 ~28
         47        SEND_VAR                                                 !3
         48        DO_ICALL                                         $29     
         49        ASSIGN                                                   !7, $29
   29    50        INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !7
         52        DO_ICALL                                                 
   26    53      > JMP                                                      ->39
         54    >   FE_FREE                                                  $24
   41    55        ECHO                                                     '%3C%2Ftd%3E'
   42    56        ECHO                                                     '%3C%2Ftr%3E'
   20    57      > JMP                                                      ->28
         58    >   FE_FREE                                                  $18
    6    59      > JMP                                                      ->3
         60    >   FE_FREE                                                  $8
   45    61        ECHO                                                     '%3C%2Ftable%3E'
   46    62      > RETURN                                                   null

End of function echo_table

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.92 ms | 1411 KiB | 20 Q