3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "php/127/typescript/12/jquery/120/angular/50"; preg_match_all("/([^\/]*?)\/(\d+)/", $str, $match); /* result: Array ( [0] => Array ( [0] => php/127 [1] => typescript/12 [2] => jquery/120 [3] => angular/50 ) [1] => Array ( [0] => php [1] => typescript [2] => jquery [3] => angular ) [2] => Array ( [0] => 127 [1] => 12 [2] => 120 [3] => 50 ) ) */ #then combine match[1] and match[2] $result = array_combine($match[1], $match[2]); /* result Array ( [php] => 127 [typescript] => 12 [jquery] => 120 [angular] => 50 ) */ print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/blZhU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $match, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'php%2F127%2Ftypescript%2F12%2Fjquery%2F120%2Fangular%2F50'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5B%5E%5C%2F%5D%2A%3F%29%5C%2F%28%5Cd%2B%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   38     6        INIT_FCALL                                               'array_combine'
          7        FETCH_DIM_R                                      ~5      !1, 1
          8        SEND_VAL                                                 ~5
          9        FETCH_DIM_R                                      ~6      !1, 2
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   49    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.4 ms | 1446 KiB | 16 Q