3v4l.org

run code in 300+ PHP versions simultaneously
<?php $car = (object)[ 'general' => [ 'interior' => [ 'seats' => 'destroyed' ] ], 'other' => [ 'exterior' => [ 'hood' => 'dull' ] ] ]; $exteriorProperties = [ 'hood' => 'shiny', 'windows' => 'dirty' ]; var_export( json_decode( json_encode( array_replace_recursive( (array)$car, ['other' => ['exterior' => $exteriorProperties]] ) ) ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oG0t7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $car, !1 = $exteriorProperties
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   CAST                                          8  ~2      <array>
    3     1        ASSIGN                                                   !0, ~2
   16     2        ASSIGN                                                   !1, <array>
   22     3        INIT_FCALL                                               'var_export'
   23     4        INIT_FCALL                                               'json_decode'
   24     5        INIT_FCALL                                               'json_encode'
   25     6        INIT_FCALL                                               'array_replace_recursive'
   26     7        CAST                                          7  ~5      !0
          8        SEND_VAL                                                 ~5
   27     9        INIT_ARRAY                                       ~6      !1, 'exterior'
         10        INIT_ARRAY                                       ~7      ~6, 'other'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
   31    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.52 ms | 1399 KiB | 21 Q