3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('log_errors', 0); $output = array(); function saveRawValue($name, $value) { $GLOBALS['output'][$name] = $value; } function parse_phpinfo() { ob_start(); phpinfo(); $s = ob_get_contents(); ob_end_clean(); $s = strip_tags($s, '<h2><th><td>'); $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', '<info>\1</info>', $s); $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', '<info>\1</info>', $s); $t = preg_split('/(<h2[^>]*>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE); $r = array(); $count = count($t); $p1 = '<info>([^<]+)<\/info>'; $p2 = '/'.$p1.'\s*'.$p1.'\s*'.$p1.'/'; $p3 = '/'.$p1.'\s*'.$p1.'/'; for ($i = 1; $i < $count; $i++) { if (preg_match('/<h2[^>]*>([^<]+)<\/h2>/', $t[$i], $matchs)) { $name = trim($matchs[1]); $vals = explode("\n", $t[$i + 1]); foreach ($vals AS $val) { if (preg_match($p2, $val, $matchs)) { // 3cols $r[$name][trim($matchs[1])] = array(trim($matchs[2]), trim($matchs[3])); } elseif (preg_match($p3, $val, $matchs)) { // 2cols $r[$name][trim($matchs[1])] = trim($matchs[2]); } } } } return $r; } saveRawValue('phpinfo', parse_phpinfo()); saveRawValue('ii.runtime_user', posix_getuid()); saveRawValue('ii.runtime_group', posix_getgid()); echo "<pre>" . json_encode($output) . "</pre>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLcFf
function name:  (null)
number of ops:  30
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'log_errors'
          2        SEND_VAL                                                 0
          3        DO_ICALL                                                 
    5     4        ASSIGN                                                   !0, <array>
   37     5        INIT_FCALL                                               'saverawvalue'
          6        SEND_VAL                                                 'phpinfo'
          7        INIT_FCALL                                               'parse_phpinfo'
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR                                                 $3
         10        DO_FCALL                                      0          
   38    11        INIT_FCALL                                               'saverawvalue'
         12        SEND_VAL                                                 'ii.runtime_user'
         13        INIT_FCALL                                               'posix_getuid'
         14        DO_ICALL                                         $5      
         15        SEND_VAR                                                 $5
         16        DO_FCALL                                      0          
   39    17        INIT_FCALL                                               'saverawvalue'
         18        SEND_VAL                                                 'ii.runtime_group'
         19        INIT_FCALL                                               'posix_getgid'
         20        DO_ICALL                                         $7      
         21        SEND_VAR                                                 $7
         22        DO_FCALL                                      0          
   42    23        INIT_FCALL                                               'json_encode'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $9      
         26        CONCAT                                           ~10     '%3Cpre%3E', $9
         27        CONCAT                                           ~11     ~10, '%3C%2Fpre%3E'
         28        ECHO                                                     ~11
         29      > RETURN                                                   1

Function saverawvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OLcFf
function name:  saveRawValue
number of ops:  7
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_W                      global              $2      'GLOBALS'
          3        FETCH_DIM_W                                      $3      $2, 'output'
          4        ASSIGN_DIM                                               $3, !0
          5        OP_DATA                                                  !1
    9     6      > RETURN                                                   null

End of function saverawvalue

Function parse_phpinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
2 jumps found. (Code = 44) Position 1 = 118, Position 2 = 51
Branch analysis from position: 118
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 115
Branch analysis from position: 58
2 jumps found. (Code = 77) Position 1 = 71, Position 2 = 114
Branch analysis from position: 71
2 jumps found. (Code = 78) Position 1 = 72, Position 2 = 114
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 96
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 113
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 102, Position 2 = 113
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
Branch analysis from position: 113
Branch analysis from position: 114
2 jumps found. (Code = 44) Position 1 = 118, Position 2 = 51
Branch analysis from position: 118
Branch analysis from position: 51
Branch analysis from position: 114
Branch analysis from position: 115
filename:       /in/OLcFf
function name:  parse_phpinfo
number of ops:  120
compiled vars:  !0 = $s, !1 = $t, !2 = $r, !3 = $count, !4 = $p1, !5 = $p2, !6 = $p3, !7 = $i, !8 = $matchs, !9 = $name, !10 = $vals, !11 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
          2        INIT_FCALL                                               'phpinfo'
          3        DO_ICALL                                                 
          4        INIT_FCALL                                               'ob_get_contents'
          5        DO_ICALL                                         $14     
          6        ASSIGN                                                   !0, $14
          7        INIT_FCALL                                               'ob_end_clean'
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'strip_tags'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%3Ch2%3E%3Cth%3E%3Ctd%3E'
         12        DO_ICALL                                         $17     
         13        ASSIGN                                                   !0, $17
   14    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%3Cth%5B%5E%3E%5D%2A%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Fth%3E%2F'
         16        SEND_VAL                                                 '%3Cinfo%3E%5C1%3C%2Finfo%3E'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $19     
         19        ASSIGN                                                   !0, $19
   15    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%2F%3Ctd%5B%5E%3E%5D%2A%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Ftd%3E%2F'
         22        SEND_VAL                                                 '%3Cinfo%3E%5C1%3C%2Finfo%3E'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !0, $21
   16    26        INIT_FCALL                                               'preg_split'
         27        SEND_VAL                                                 '%2F%28%3Ch2%5B%5E%3E%5D%2A%3E%5B%5E%3C%5D%2B%3C%5C%2Fh2%3E%29%2F'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 -1
         30        SEND_VAL                                                 2
         31        DO_ICALL                                         $23     
         32        ASSIGN                                                   !1, $23
   17    33        ASSIGN                                                   !2, <array>
         34        COUNT                                            ~26     !1
         35        ASSIGN                                                   !3, ~26
   18    36        ASSIGN                                                   !4, '%3Cinfo%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Finfo%3E'
   19    37        CONCAT                                           ~29     '%2F', !4
         38        CONCAT                                           ~30     ~29, '%5Cs%2A'
         39        CONCAT                                           ~31     ~30, !4
         40        CONCAT                                           ~32     ~31, '%5Cs%2A'
         41        CONCAT                                           ~33     ~32, !4
         42        CONCAT                                           ~34     ~33, '%2F'
         43        ASSIGN                                                   !5, ~34
   20    44        CONCAT                                           ~36     '%2F', !4
         45        CONCAT                                           ~37     ~36, '%5Cs%2A'
         46        CONCAT                                           ~38     ~37, !4
         47        CONCAT                                           ~39     ~38, '%2F'
         48        ASSIGN                                                   !6, ~39
   21    49        ASSIGN                                                   !7, 1
         50      > JMP                                                      ->116
   22    51    >   INIT_FCALL                                               'preg_match'
         52        SEND_VAL                                                 '%2F%3Ch2%5B%5E%3E%5D%2A%3E%28%5B%5E%3C%5D%2B%29%3C%5C%2Fh2%3E%2F'
         53        FETCH_DIM_R                                      ~42     !1, !7
         54        SEND_VAL                                                 ~42
         55        SEND_REF                                                 !8
         56        DO_ICALL                                         $43     
         57      > JMPZ                                                     $43, ->115
   23    58    >   INIT_FCALL                                               'trim'
         59        FETCH_DIM_R                                      ~44     !8, 1
         60        SEND_VAL                                                 ~44
         61        DO_ICALL                                         $45     
         62        ASSIGN                                                   !9, $45
   24    63        INIT_FCALL                                               'explode'
         64        SEND_VAL                                                 '%0A'
         65        ADD                                              ~47     !7, 1
         66        FETCH_DIM_R                                      ~48     !1, ~47
         67        SEND_VAL                                                 ~48
         68        DO_ICALL                                         $49     
         69        ASSIGN                                                   !10, $49
   25    70      > FE_RESET_R                                       $51     !10, ->114
         71    > > FE_FETCH_R                                               $51, !11, ->114
   26    72    >   INIT_FCALL                                               'preg_match'
         73        SEND_VAR                                                 !5
         74        SEND_VAR                                                 !11
         75        SEND_REF                                                 !8
         76        DO_ICALL                                         $52     
         77      > JMPZ                                                     $52, ->96
   27    78    >   INIT_FCALL                                               'trim'
         79        FETCH_DIM_R                                      ~54     !8, 1
         80        SEND_VAL                                                 ~54
         81        DO_ICALL                                         $55     
         82        INIT_FCALL                                               'trim'
         83        FETCH_DIM_R                                      ~57     !8, 2
         84        SEND_VAL                                                 ~57
         85        DO_ICALL                                         $58     
         86        INIT_ARRAY                                       ~59     $58
         87        INIT_FCALL                                               'trim'
         88        FETCH_DIM_R                                      ~60     !8, 3
         89        SEND_VAL                                                 ~60
         90        DO_ICALL                                         $61     
         91        ADD_ARRAY_ELEMENT                                ~59     $61
         92        FETCH_DIM_W                                      $53     !2, !9
         93        ASSIGN_DIM                                               $53, $55
         94        OP_DATA                                                  ~59
         95      > JMP                                                      ->113
   28    96    >   INIT_FCALL                                               'preg_match'
         97        SEND_VAR                                                 !6
         98        SEND_VAR                                                 !11
         99        SEND_REF                                                 !8
        100        DO_ICALL                                         $62     
        101      > JMPZ                                                     $62, ->113
   29   102    >   INIT_FCALL                                               'trim'
        103        FETCH_DIM_R                                      ~64     !8, 1
        104        SEND_VAL                                                 ~64
        105        DO_ICALL                                         $65     
        106        INIT_FCALL                                               'trim'
        107        FETCH_DIM_R                                      ~67     !8, 2
        108        SEND_VAL                                                 ~67
        109        DO_ICALL                                         $68     
        110        FETCH_DIM_W                                      $63     !2, !9
        111        ASSIGN_DIM                                               $63, $65
        112        OP_DATA                                                  $68
   25   113    > > JMP                                                      ->71
        114    >   FE_FREE                                                  $51
   21   115    >   PRE_INC                                                  !7
        116    >   IS_SMALLER                                               !7, !3
        117      > JMPNZ                                                    ~70, ->51
   34   118    > > RETURN                                                   !2
   35   119*     > RETURN                                                   null

End of function parse_phpinfo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.17 ms | 1411 KiB | 45 Q