3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "2=OK, 3=OK" ; preg_match_all('!\d+!', $string, $matches); $res = array_combine($matches[0], str_word_count($string, 1)); print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SlS8C
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string, !1 = $matches, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2%3DOK%2C+3%3DOK'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%21%5Cd%2B%21'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'array_combine'
          7        FETCH_DIM_R                                      ~5      !1, 0
          8        SEND_VAL                                                 ~5
          9        INIT_FCALL                                               'str_word_count'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 1
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        DO_ICALL                                         $7      
         15        ASSIGN                                                   !2, $7
    6    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.49 ms | 1000 KiB | 17 Q