3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '~<(\d+)>\h*(\d+(?:\.\d+)?)\h*</\h*\1>~m'; $str = '<5> 20825.24 </ 5> <7> 0.0 </ 7> <8> 0.0 </ 8>'; preg_match_all($re, $str, $matches); print_r(array_combine($matches[1], $matches[2]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/umJkl
function name:  (null)
number of ops:  17
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7E%3C%28%5Cd%2B%29%3E%5Ch%2A%28%5Cd%2B%28%3F%3A%5C.%5Cd%2B%29%3F%29%5Ch%2A%3C%2F%5Ch%2A%5C1%3E%7Em'
    4     1        ASSIGN                                                   !1, '%3C5%3E+20825.24+%3C%2F+5%3E+%3C7%3E+0.0+%3C%2F+7%3E+%3C8%3E+0.0+%3C%2F+8%3E'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    6     7        INIT_FCALL                                               'print_r'
          8        INIT_FCALL                                               'array_combine'
          9        FETCH_DIM_R                                      ~6      !2, 1
         10        SEND_VAL                                                 ~6
         11        FETCH_DIM_R                                      ~7      !2, 2
         12        SEND_VAL                                                 ~7
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.09 ms | 1399 KiB | 19 Q