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 = "000three!000red0!000four000white!0000five!000black0!"; $pat = "/\d+(\D+)\d+(\D+)\d!/um"; preg_match($pat, $str, $match); $merged = $original; foreach($match as $result) { echo $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 = 14
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/m5Zpo
function name:  (null)
number of ops:  16
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, '000three%21000red0%21000four000white%210000five%21000black0%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, ->14
         11    > > FE_FETCH_R                                               $12, !5, ->14
   23    12    >   ECHO                                                     !5
   22    13      > JMP                                                      ->11
         14    >   FE_FREE                                                  $12
   28    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.55 ms | 1395 KiB | 15 Q