3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '( NETR5_2 R6,1 R5,2 ) ( NETR1_2 R4,2 R3,1 R3,2 R2,1 R2,2 R1,1 R1,2 )'; $chunks = explode(")(", preg_replace('/\)\W+\(/m', ')(', $text)); $result = array(); $pattern = '{([A-z0-9,]+)}'; foreach ($chunks as $row) { preg_match_all($pattern, $row, $matches); $result[] = $matches[1]; } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/r3SF5
function name:  (null)
number of ops:  29
compiled vars:  !0 = $text, !1 = $chunks, !2 = $result, !3 = $pattern, !4 = $row, !5 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28%0ANETR5_2%0AR6%2C1%0AR5%2C2%0A%29%0A%28%0ANETR1_2%0AR4%2C2%0AR3%2C1%0AR3%2C2%0AR2%2C1%0AR2%2C2%0AR1%2C1%0AR1%2C2%0A%29'
   19     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%29%28'
          3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAL                                                 '%2F%5C%29%5CW%2B%5C%28%2Fm'
          5        SEND_VAL                                                 '%29%28'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
   20    11        ASSIGN                                                   !2, <array>
   21    12        ASSIGN                                                   !3, '%7B%28%5BA-z0-9%2C%5D%2B%29%7D'
   23    13      > FE_RESET_R                                       $12     !1, ->24
         14    > > FE_FETCH_R                                               $12, !4, ->24
   24    15    >   INIT_FCALL                                               'preg_match_all'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !4
         18        SEND_REF                                                 !5
         19        DO_ICALL                                                 
   25    20        FETCH_DIM_R                                      ~15     !5, 1
         21        ASSIGN_DIM                                               !2
         22        OP_DATA                                                  ~15
   23    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $12
   28    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.01 ms | 1002 KiB | 17 Q