3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = ['page' => ['title' => 'old title', 'description' => 'old description']]; $second = ['page' => ['title' => 'new title']]; $merge = array_merge_recursive($first, $second); $replace = array_replace_recursive($first, $second); assert($merge['page']['title'] === 'new title'); assert($merge['page']['description'] === 'old description'); assert($replace['page']['title'] === 'new title'); assert($replace['page']['description'] === 'old description');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2ICmo
function name:  (null)
number of ops:  45
compiled vars:  !0 = $first, !1 = $second, !2 = $merge, !3 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_merge_recursive'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    7     7        INIT_FCALL                                               'array_replace_recursive'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !3, $8
    9    12        ASSERT_CHECK                                             
         13        INIT_FCALL                                               'assert'
         14        FETCH_DIM_R                                      ~10     !2, 'page'
         15        FETCH_DIM_R                                      ~11     ~10, 'title'
         16        IS_IDENTICAL                                     ~12     ~11, 'new+title'
         17        SEND_VAL                                                 ~12
         18        SEND_VAL                                                 'assert%28%24merge%5B%27page%27%5D%5B%27title%27%5D+%3D%3D%3D+%27new+title%27%29'
         19        DO_ICALL                                                 
   10    20        ASSERT_CHECK                                             
         21        INIT_FCALL                                               'assert'
         22        FETCH_DIM_R                                      ~14     !2, 'page'
         23        FETCH_DIM_R                                      ~15     ~14, 'description'
         24        IS_IDENTICAL                                     ~16     ~15, 'old+description'
         25        SEND_VAL                                                 ~16
         26        SEND_VAL                                                 'assert%28%24merge%5B%27page%27%5D%5B%27description%27%5D+%3D%3D%3D+%27old+description%27%29'
         27        DO_ICALL                                                 
   11    28        ASSERT_CHECK                                             
         29        INIT_FCALL                                               'assert'
         30        FETCH_DIM_R                                      ~18     !3, 'page'
         31        FETCH_DIM_R                                      ~19     ~18, 'title'
         32        IS_IDENTICAL                                     ~20     ~19, 'new+title'
         33        SEND_VAL                                                 ~20
         34        SEND_VAL                                                 'assert%28%24replace%5B%27page%27%5D%5B%27title%27%5D+%3D%3D%3D+%27new+title%27%29'
         35        DO_ICALL                                                 
   12    36        ASSERT_CHECK                                             
         37        INIT_FCALL                                               'assert'
         38        FETCH_DIM_R                                      ~22     !3, 'page'
         39        FETCH_DIM_R                                      ~23     ~22, 'description'
         40        IS_IDENTICAL                                     ~24     ~23, 'old+description'
         41        SEND_VAL                                                 ~24
         42        SEND_VAL                                                 'assert%28%24replace%5B%27page%27%5D%5B%27description%27%5D+%3D%3D%3D+%27old+description%27%29'
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.97 ms | 1405 KiB | 19 Q