3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Files("textfile1.txt", 7268474425, "textfile2.txt", 661204928, "textfile3.txt", 121034)'; $result = []; preg_match_all('/(?:^\w+\(|\G, )"([^"]+)", (\d+)/', $string, $matches, PREG_SET_ORDER); foreach ($matches as [1 => $key, 2 => $val]) { $result[$key] = (int) $val; } var_export($result);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.7
array ( 'textfile1.txt' => 7268474425, 'textfile2.txt' => 661204928, 'textfile3.txt' => 121034, )

preferences:
93.96 ms | 1262 KiB | 4 Q