3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'NAME OF ITEM 123456789012 OTHER NAME 987654321098 NAME 567890123456'; preg_match_all( '/^(.*?)\s+(\d+)/m', $str, $matches); var_dump( $matches); $items = array(); foreach( $matches[2] as $k => $upc) { $items[$upc] = $matches[1][$k]; } var_dump( $items);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/6BXVe
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str, !1 = $matches, !2 = $items, !3 = $upc, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'NAME+OF+ITEM+123456789012%0AOTHER+NAME+++987654321098%0ANAME+++++++++567890123456'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5E%28.%2A%3F%29%5Cs%2B%28%5Cd%2B%29%2Fm'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    8     9        ASSIGN                                                   !2, <array>
    9    10        FETCH_DIM_R                                      ~9      !1, 2
         11      > FE_RESET_R                                       $10     ~9, ->19
         12    > > FE_FETCH_R                                       ~11     $10, !3, ->19
         13    >   ASSIGN                                                   !4, ~11
   10    14        FETCH_DIM_R                                      ~14     !1, 1
         15        FETCH_DIM_R                                      ~15     ~14, !4
         16        ASSIGN_DIM                                               !2, !3
         17        OP_DATA                                                  ~15
    9    18      > JMP                                                      ->12
         19    >   FE_FREE                                                  $10
   12    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.39 ms | 1395 KiB | 17 Q