3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Files("textfile1.txt", 7268474425, "textfile2.txt", 661204928, "textfile3.txt", 121034)'; $result = []; foreach (explode(', ', substr($string, 6, -1)) as $val) { if (!isset($key)) { $key = trim($val, '"'); } else { $result[$key] = (int) $val; unset($key); } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/6KgB5
function name:  (null)
number of ops:  32
compiled vars:  !0 = $string, !1 = $result, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Files%28%22textfile1.txt%22%2C+7268474425%2C+%22textfile2.txt%22%2C+661204928%2C+%22textfile3.txt%22%2C+121034%29'
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C+'
          4        INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 6
          7        SEND_VAL                                                 -1
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                         $7      
         11      > FE_RESET_R                                       $8      $7, ->27
         12    > > FE_FETCH_R                                               $8, !2, ->27
    7    13    >   ISSET_ISEMPTY_CV                                 ~9      !3
         14        BOOL_NOT                                         ~10     ~9
         15      > JMPZ                                                     ~10, ->22
    8    16    >   INIT_FCALL                                               'trim'
         17        SEND_VAR                                                 !2
         18        SEND_VAL                                                 '%22'
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
    7    21      > JMP                                                      ->26
   10    22    >   CAST                                          4  ~14     !2
         23        ASSIGN_DIM                                               !1, !3
         24        OP_DATA                                                  ~14
   11    25        UNSET_CV                                                 !3
    6    26    > > JMP                                                      ->12
         27    >   FE_FREE                                                  $8
   14    28        INIT_FCALL                                               'var_export'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.96 ms | 1009 KiB | 17 Q