3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = array ( array ("title" => "one", "color" => "blue" ), array ("title" => "two", "color" => "green" ) ); $merged = array(); $str = "000three000red0!000four000white0!000five000black0!"; $pat = "/\d+(\D+)\d+(\D+)\d!/um"; preg_match($pat, $str, $match); $merged = $original; foreach($match as $result) { $merged[] = array("title" => $match[1], "color" => $match[2]); } print_r($merged);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/blIOH
function name:  (null)
number of ops:  24
compiled vars:  !0 = $original, !1 = $merged, !2 = $str, !3 = $pat, !4 = $match, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   15     2        ASSIGN                                                   !2, '000three000red0%21000four000white0%21000five000black0%21'
   16     3        ASSIGN                                                   !3, '%2F%5Cd%2B%28%5CD%2B%29%5Cd%2B%28%5CD%2B%29%5Cd%21%2Fum'
   18     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !3
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !4
          8        DO_ICALL                                                 
   20     9        ASSIGN                                                   !1, !0
   22    10      > FE_RESET_R                                       $12     !4, ->19
         11    > > FE_FETCH_R                                               $12, !5, ->19
   24    12    >   FETCH_DIM_R                                      ~14     !4, 1
         13        INIT_ARRAY                                       ~15     ~14, 'title'
         14        FETCH_DIM_R                                      ~16     !4, 2
         15        ADD_ARRAY_ELEMENT                                ~15     ~16, 'color'
         16        ASSIGN_DIM                                               !1
         17        OP_DATA                                                  ~15
   22    18      > JMP                                                      ->11
         19    >   FE_FREE                                                  $12
   28    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1395 KiB | 17 Q