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" => $result, "color" => $result); } print_r($merged);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/OFDJD
function name:  (null)
number of ops:  22
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, ->17
         11    > > FE_FETCH_R                                               $12, !5, ->17
   24    12    >   INIT_ARRAY                                       ~14     !5, 'title'
         13        ADD_ARRAY_ELEMENT                                ~14     !5, 'color'
         14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  ~14
   22    16      > JMP                                                      ->11
         17    >   FE_FREE                                                  $12
   28    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.78 ms | 1395 KiB | 17 Q