3v4l.org

run code in 300+ PHP versions simultaneously
<?php //include(__DIR__.'/inc/functions.inc.php'); if (true) { function array2string($var) { switch (($type = gettype($var))) { case 'boolean': return $var ? 'TRUE' : 'FALSE'; case 'string': return "'$var'"; case 'integer': case 'double': case 'resource': return $var; case 'NULL': return 'NULL'; case 'object': case 'array': return str_replace(array("\n",' '/*,'Array'*/),'',print_r($var,true)); } return 'UNKNOWN TYPE!'; } function lang($key,$vars=null) { if(!is_array($vars)) { $vars = func_get_args(); array_shift($vars); // remove $key } return translate($key,$vars); } function translate($key, $vars=null, $not_found='' ) { $ret = $key; if (is_array($vars) && count($vars)) { if (count($vars) > 1) { static $placeholders = array('%3','%2','%1','|%2|','|%3|','%4','%5','%6','%7','%8','%9','%10'); // to cope with $vars[0] containing '%2' (eg. an urlencoded path like a referer), // we first replace '%2' in $ret with '|%2|' and then use that as 2. placeholder // we do that for %3 as well, ... $vars = array_merge(array('|%3|','|%2|'),$vars); // push '|%2|' (and such) as first replacement on $vars $ret = str_replace($placeholders,$vars,$ret); } else { $ret = str_replace('%1',$vars[0],$ret); } } return $ret; } } $checks = array( 'allow_url_fopen' => array( 'func' => 'php_ini_check', 'value' => 1, 'verbose_value' => 'On', 'error' => lang('%1 setting "%2" = %3 disallows access via http!', 'php.ini', 'allow_url_fopen', array2string(ini_get('allow_url_fopen'))), ), ); echo "<pre>\n".print_r($checks, true)."</pre>\n"; die(array2string(ini_get('allow_url_fopen')));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 4
Branch analysis from position: 1
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 4
filename:       /in/gvuTS
function name:  (null)
number of ops:  37
compiled vars:  !0 = $checks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <true>, ->4
    4     1    >   DECLARE_FUNCTION                                         'array2string'
   25     2        DECLARE_FUNCTION                                         'lang'
   34     3        DECLARE_FUNCTION                                         'translate'
   58     4    >   INIT_ARRAY                                       ~1      'php_ini_check', 'func'
   59     5        ADD_ARRAY_ELEMENT                                ~1      1, 'value'
   60     6        ADD_ARRAY_ELEMENT                                ~1      'On', 'verbose_value'
   61     7        INIT_FCALL_BY_NAME                                       'lang'
          8        SEND_VAL_EX                                              '%251+setting+%22%252%22+%3D+%253+disallows+access+via+http%21'
   62     9        SEND_VAL_EX                                              'php.ini'
         10        SEND_VAL_EX                                              'allow_url_fopen'
         11        INIT_FCALL_BY_NAME                                       'array2string'
         12        INIT_FCALL                                               'ini_get'
         13        SEND_VAL                                                 'allow_url_fopen'
         14        DO_ICALL                                         $2      
         15        SEND_VAR_NO_REF_EX                                       $2
         16        DO_FCALL                                      0  $3      
         17        SEND_VAR_NO_REF_EX                                       $3
   61    18        DO_FCALL                                      0  $4      
   62    19        ADD_ARRAY_ELEMENT                                ~1      $4, 'error'
         20        INIT_ARRAY                                       ~5      ~1, 'allow_url_fopen'
   56    21        ASSIGN                                                   !0, ~5
   65    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $7      
         26        CONCAT                                           ~8      '%3Cpre%3E%0A', $7
         27        CONCAT                                           ~9      ~8, '%3C%2Fpre%3E%0A'
         28        ECHO                                                     ~9
   66    29        INIT_FCALL_BY_NAME                                       'array2string'
         30        INIT_FCALL                                               'ini_get'
         31        SEND_VAL                                                 'allow_url_fopen'
         32        DO_ICALL                                         $10     
         33        SEND_VAR_NO_REF_EX                                       $10
         34        DO_FCALL                                      0  $11     
         35      > EXIT                                                     $11
         36*     > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
10 jumps found. (Code = 188) Position 1 = 21, Position 2 = 27, Position 3 = 32, Position 4 = 32, Position 5 = 32, Position 6 = 34, Position 7 = 36, Position 8 = 36, Position 9 = 47, Position 10 = 4
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 32
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 32
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 32
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 34
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 36
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 36
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 36
Branch analysis from position: 36
Branch analysis from position: 34
Branch analysis from position: 32
Branch analysis from position: 32
Branch analysis from position: 32
Branch analysis from position: 27
Branch analysis from position: 21
filename:       /in/gvuTS
function name:  array2string
number of ops:  50
compiled vars:  !0 = $var, !1 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        GET_TYPE                                         ~2      !0
          2        ASSIGN                                           ~3      !1, ~2
          3      > SWITCH_STRING                                            ~3, [ 'boolean':->21, 'string':->27, 'integer':->32, 'double':->32, 'resource':->32, 'NULL':->34, 'object':->36, 'array':->36, ], ->47
    8     4    >   CASE                                                     ~3, 'boolean'
          5      > JMPNZ                                                    ~4, ->21
   10     6    >   CASE                                                     ~3, 'string'
          7      > JMPNZ                                                    ~4, ->27
   12     8    >   CASE                                                     ~3, 'integer'
          9      > JMPNZ                                                    ~4, ->32
   13    10    >   CASE                                                     ~3, 'double'
         11      > JMPNZ                                                    ~4, ->32
   14    12    >   CASE                                                     ~3, 'resource'
         13      > JMPNZ                                                    ~4, ->32
   16    14    >   CASE                                                     ~3, 'NULL'
         15      > JMPNZ                                                    ~4, ->34
   18    16    >   CASE                                                     ~3, 'object'
         17      > JMPNZ                                                    ~4, ->36
   19    18    >   CASE                                                     ~3, 'array'
         19      > JMPNZ                                                    ~4, ->36
         20    > > JMP                                                      ->47
    9    21    > > JMPZ                                                     !0, ->24
         22    >   QM_ASSIGN                                        ~5      'TRUE'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~5      'FALSE'
         25    >   FREE                                                     ~3
         26      > RETURN                                                   ~5
   11    27    >   ROPE_INIT                                     3  ~7      '%27'
         28        ROPE_ADD                                      1  ~7      ~7, !0
         29        ROPE_END                                      2  ~6      ~7, '%27'
         30        FREE                                                     ~3
         31      > RETURN                                                   ~6
   15    32    >   FREE                                                     ~3
         33      > RETURN                                                   !0
   17    34    >   FREE                                                     ~3
         35      > RETURN                                                   'NULL'
   20    36    >   INIT_FCALL                                               'str_replace'
         37        SEND_VAL                                                 <array>
         38        SEND_VAL                                                 ''
         39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !0
         41        SEND_VAL                                                 <true>
         42        DO_ICALL                                         $9      
         43        SEND_VAR                                                 $9
         44        DO_ICALL                                         $10     
         45        FREE                                                     ~3
         46      > RETURN                                                   $10
         47    >   FREE                                                     ~3
   22    48      > RETURN                                                   'UNKNOWN+TYPE%21'
   23    49*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/gvuTS
function name:  lang
number of ops:  16
compiled vars:  !0 = $key, !1 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   27     2        TYPE_CHECK                                  128  ~2      !1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->10
   29     5    >   FUNC_GET_ARGS                                    ~4      
          6        ASSIGN                                                   !1, ~4
   30     7        INIT_FCALL                                               'array_shift'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                                 
   32    10    >   INIT_FCALL_BY_NAME                                       'translate'
         11        SEND_VAR_EX                                              !0
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $7      
         14      > RETURN                                                   $7
   33    15*     > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 32
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 8
filename:       /in/gvuTS
function name:  translate
number of ops:  34
compiled vars:  !0 = $key, !1 = $vars, !2 = $not_found, !3 = $ret, !4 = $placeholders
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      ''
   36     3        ASSIGN                                                   !3, !0
   37     4        TYPE_CHECK                                  128  ~6      !1
          5      > JMPZ_EX                                          ~6      ~6, ->8
          6    >   COUNT                                            ~7      !1
          7        BOOL                                             ~6      ~7
          8    > > JMPZ                                                     ~6, ->32
   39     9    >   COUNT                                            ~8      !1
         10        IS_SMALLER                                               1, ~8
         11      > JMPZ                                                     ~9, ->25
   41    12    >   BIND_STATIC                                              !4
   45    13        INIT_FCALL                                               'array_merge'
         14        SEND_VAL                                                 <array>
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !1, $10
   46    18        INIT_FCALL                                               'str_replace'
         19        SEND_VAR                                                 !4
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $12     
         23        ASSIGN                                                   !3, $12
   39    24      > JMP                                                      ->32
   50    25    >   INIT_FCALL                                               'str_replace'
         26        SEND_VAL                                                 '%251'
         27        FETCH_DIM_R                                      ~14     !1, 0
         28        SEND_VAL                                                 ~14
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $15     
         31        ASSIGN                                                   !3, $15
   53    32    > > RETURN                                                   !3
   54    33*     > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.53 ms | 1028 KiB | 18 Q