3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = array("orange", "banana", "apple", "raspberry"); $replacements = array(0 => "pineapple", 4 => "cherry"); $replacements2 = array(0 => "grape"); $basket = array_replace($base, $replacements, $replacements2); print_r($basket); $array1 = array("color" => "red", 2, 4); $array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4); $result = array_merge($array1, $array2); print_r($result); print_r(array_replace($array1, $array2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QCisY
function name:  (null)
number of ops:  30
compiled vars:  !0 = $base, !1 = $replacements, !2 = $replacements2, !3 = $basket, !4 = $array1, !5 = $array2, !6 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'array_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !3, $10
    8     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                                 
   10    12        ASSIGN                                                   !4, <array>
   11    13        ASSIGN                                                   !5, <array>
   12    14        INIT_FCALL                                               'array_merge'
         15        SEND_VAR                                                 !4
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !6, $15
   13    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !6
         21        DO_ICALL                                                 
   15    22        INIT_FCALL                                               'print_r'
         23        INIT_FCALL                                               'array_replace'
         24        SEND_VAR                                                 !4
         25        SEND_VAR                                                 !5
         26        DO_ICALL                                         $18     
         27        SEND_VAR                                                 $18
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.18 ms | 1395 KiB | 19 Q