3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = array( '"^0user1^7" "2"', '"user2" "2"', '"user3" "6"', '"user with spaces" "91"', ); $regex = '#"(?<user>[a-zA-Z0-9\^\s]+)"\s"(?<num>\d+)"#'; foreach ($lines as $line) { preg_match($regex, $line, $matches); echo 'user = '.$matches['user'].', num = '.$matches['num']."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/qDVuf
function name:  (null)
number of ops:  19
compiled vars:  !0 = $lines, !1 = $regex, !2 = $line, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, '%23%22%28%3F%3Cuser%3E%5Ba-zA-Z0-9%5C%5E%5Cs%5D%2B%29%22%5Cs%22%28%3F%3Cnum%3E%5Cd%2B%29%22%23'
   12     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                               $6, !2, ->17
   13     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                                 
   14     9        FETCH_DIM_R                                      ~8      !3, 'user'
         10        CONCAT                                           ~9      'user+%3D+', ~8
         11        CONCAT                                           ~10     ~9, '%2C+num+%3D+'
         12        FETCH_DIM_R                                      ~11     !3, 'num'
         13        CONCAT                                           ~12     ~10, ~11
         14        CONCAT                                           ~13     ~12, '%0A'
         15        ECHO                                                     ~13
   12    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   15    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.98 ms | 1010 KiB | 14 Q