3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'php/127/typescript/12/jquery/120/angular/50'; $list = explode('/', $str); $list_count = count($list); $result = array(); for ($i=0 ; $i<$list_count; $i+=2) { $result[ $list[$i] ] = $list[$i+1]; } print_r($result); ?>
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
Array ( [php] => 127 [typescript] => 12 [jquery] => 120 [angular] => 50 )

preferences:
85.52 ms | 407 KiB | 5 Q