3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ini = <<<INI TPL_CONTACT_MISC="Miscellaneous Info" date.timezone = Pacific/Tahiti TPL_CONTACT_MISC="Your german misc info translation" COM_TODO_ALIGN="Image Float" JOOMLA! DEFAULT IMAGES=Жуумла! үндсэн зурагнууд COM_TODO_ALIGN_DESC="This will apply the classes 'pull-left', 'pull-center' or 'pull-right' to the '<figure>' or '<img>' element" COM_TODO_BROWSE_FILES="Browse files" COM_TODO_CAPTION="Caption" COM_TODO_CAPTION_CLASS_LABEL="Caption Class" COM_MEMBERSHIPS_FIELD_MEMBERSHIP_LABEL 911 COM_FRED_GREETING='Hello' COM_FRED_GREETING_BARNEY='Yo, Buddy' DR_SOLD="SOLD" upload_tmp_dir = /var/www/html/tmp INI; $result = []; foreach (explode(PHP_EOL, $ini) as $i => $line) { $parsed = @parse_ini_string($line); if (!is_array($parsed)) { $anomalies[] = "Invalid character(s) @ line index $i: $line"; continue; } $key = key($parsed); if ($key === null) { $anomalies[] = "No valid declaration @ line index $i: $line"; } elseif (key_exists($key, $result)) { $anomalies[] = "Redundant key declaration @ line index $i: $key => $parsed[$key]"; } else { $result[$key] = $parsed[$key]; } } var_export($anomalies); echo "\n---\n"; var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 57
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 57
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 53
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
filename:       /in/0d83G
function name:  (null)
number of ops:  66
compiled vars:  !0 = $ini, !1 = $result, !2 = $line, !3 = $i, !4 = $parsed, !5 = $anomalies, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'TPL_CONTACT_MISC%3D%22Miscellaneous+Info%22%0Adate.timezone+%3D+Pacific%2FTahiti%0ATPL_CONTACT_MISC%3D%22Your+german+misc+info+translation%22%0ACOM_TODO_ALIGN%3D%22Image+Float%22%0AJOOMLA%21+DEFAULT+IMAGES%3D%D0%96%D1%83%D1%83%D0%BC%D0%BB%D0%B0%21+%D2%AF%D0%BD%D0%B4%D1%81%D1%8D%D0%BD+%D0%B7%D1%83%D1%80%D0%B0%D0%B3%D0%BD%D1%83%D1%83%D0%B4%0ACOM_TODO_ALIGN_DESC%3D%22This+will+apply+the+classes+%27pull-left%27%2C+%27pull-center%27+or+%27pull-right%27+to+the+%27%3Cfigure%3E%27+or+%27%3Cimg%3E%27+element%22%0ACOM_TODO_BROWSE_FILES%3D%22Browse+files%22%0ACOM_TODO_CAPTION%3D%22Caption%22%0ACOM_TODO_CAPTION_CLASS_LABEL%3D%22Caption+Class%22%0ACOM_MEMBERSHIPS_FIELD_MEMBERSHIP_LABEL+911%0ACOM_FRED_GREETING%3D%27Hello%27%0ACOM_FRED_GREETING_BARNEY%3D%27Yo%2C+Buddy%27%0ADR_SOLD%3D%22SOLD%22%0Aupload_tmp_dir+%3D+%2Fvar%2Fwww%2Fhtml%2Ftmp'
   20     1        ASSIGN                                                   !1, <array>
   21     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6      > FE_RESET_R                                       $10     $9, ->57
          7    > > FE_FETCH_R                                       ~11     $10, !2, ->57
          8    >   ASSIGN                                                   !3, ~11
   22     9        BEGIN_SILENCE                                    ~13     
         10        INIT_FCALL                                               'parse_ini_string'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $14     
         13        END_SILENCE                                              ~13
         14        ASSIGN                                                   !4, $14
   23    15        TYPE_CHECK                                  128  ~16     !4
         16        BOOL_NOT                                         ~17     ~16
         17      > JMPZ                                                     ~17, ->25
   24    18    >   ROPE_INIT                                     4  ~20     'Invalid+character%28s%29+%40+line+index+'
         19        ROPE_ADD                                      1  ~20     ~20, !3
         20        ROPE_ADD                                      2  ~20     ~20, '%3A+'
         21        ROPE_END                                      3  ~19     ~20, !2
         22        ASSIGN_DIM                                               !5
         23        OP_DATA                                                  ~19
   25    24      > JMP                                                      ->7
   27    25    >   INIT_FCALL                                               'key'
         26        SEND_VAR                                                 !4
         27        DO_ICALL                                         $22     
         28        ASSIGN                                                   !6, $22
   28    29        TYPE_CHECK                                    2          !6
         30      > JMPZ                                                     ~24, ->38
   29    31    >   ROPE_INIT                                     4  ~27     'No+valid+declaration+%40+line+index+'
         32        ROPE_ADD                                      1  ~27     ~27, !3
         33        ROPE_ADD                                      2  ~27     ~27, '%3A+'
         34        ROPE_END                                      3  ~26     ~27, !2
         35        ASSIGN_DIM                                               !5
         36        OP_DATA                                                  ~26
   28    37      > JMP                                                      ->56
   30    38    >   INIT_FCALL                                               'key_exists'
         39        SEND_VAR                                                 !6
         40        SEND_VAR                                                 !1
         41        DO_ICALL                                         $29     
         42      > JMPZ                                                     $29, ->53
   31    43    >   ROPE_INIT                                     6  ~33     'Redundant+key+declaration+%40+line+index+'
         44        ROPE_ADD                                      1  ~33     ~33, !3
         45        ROPE_ADD                                      2  ~33     ~33, '%3A+'
         46        ROPE_ADD                                      3  ~33     ~33, !6
         47        ROPE_ADD                                      4  ~33     ~33, '+%3D%3E+'
         48        FETCH_DIM_R                                      ~31     !4, !6
         49        ROPE_END                                      5  ~32     ~33, ~31
         50        ASSIGN_DIM                                               !5
         51        OP_DATA                                                  ~32
   30    52      > JMP                                                      ->56
   33    53    >   FETCH_DIM_R                                      ~37     !4, !6
         54        ASSIGN_DIM                                               !1, !6
         55        OP_DATA                                                  ~37
   21    56    > > JMP                                                      ->7
         57    >   FE_FREE                                                  $10
   36    58        INIT_FCALL                                               'var_export'
         59        SEND_VAR                                                 !5
         60        DO_ICALL                                                 
   37    61        ECHO                                                     '%0A---%0A'
   38    62        INIT_FCALL                                               'var_export'
         63        SEND_VAR                                                 !1
         64        DO_ICALL                                                 
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.4 ms | 1009 KiB | 18 Q