3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' => array('height' => 100), 'oembed' => false); $expected = array('params' => array('width' => 500, 'height' => 100), 'oembed' => false, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array(); $expected = $a1; var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' =>array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' =>array('width' => 100, 'stuff' => 888), 'oembed' => false); $expected = array('params' => array('width' => 100, 'height' => 200, 'stuff' => 888), 'oembed' => false, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2))); $a1 = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); $a2 = array('params' => array(), 'oembed' => true); $expected = array('params' => array('width' => 500, 'height' => 200), 'oembed' => true, 'other' => '300'); var_dump(($expected === array_replace_recursive($a1, $a2)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qSsLf
function name:  (null)
number of ops:  45
compiled vars:  !0 = $a1, !1 = $a2, !2 = $expected
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'array_replace_recursive'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        IS_IDENTICAL                                     ~7      !2, $6
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                                 
    7    11        ASSIGN                                                   !0, <array>
    8    12        ASSIGN                                                   !1, <array>
    9    13        ASSIGN                                                   !2, !0
   10    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'array_replace_recursive'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $12     
         19        IS_IDENTICAL                                     ~13     !2, $12
         20        SEND_VAL                                                 ~13
         21        DO_ICALL                                                 
   12    22        ASSIGN                                                   !0, <array>
   13    23        ASSIGN                                                   !1, <array>
   14    24        ASSIGN                                                   !2, <array>
   15    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'array_replace_recursive'
         27        SEND_VAR                                                 !0
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $18     
         30        IS_IDENTICAL                                     ~19     !2, $18
         31        SEND_VAL                                                 ~19
         32        DO_ICALL                                                 
   18    33        ASSIGN                                                   !0, <array>
   19    34        ASSIGN                                                   !1, <array>
   20    35        ASSIGN                                                   !2, <array>
   21    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'array_replace_recursive'
         38        SEND_VAR                                                 !0
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $24     
         41        IS_IDENTICAL                                     ~25     !2, $24
         42        SEND_VAL                                                 ~25
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.89 ms | 1392 KiB | 17 Q