3v4l.org

run code in 500+ PHP versions simultaneously
<?php $map = [ 'foo' => 'bar', 'foobar' => 'foo', ]; $input = 'foobar and foo'; echo str_replace(array_keys($map), array_values($map), $input); // Output: "bar bar and bar" echo strtr($input, $map); // Output: "baz and bar"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a1T8q
function name:  (null)
number of ops:  14
compiled vars:  !0 = $map, !1 = $input
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    8     1        ASSIGN                                                       !1, 'foobar+and+foo'
   10     2        INIT_FCALL                                                   'array_keys'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $4      
          5        INIT_FCALL                                                   'array_values'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $5      
          8        FRAMELESS_ICALL_3                str_replace         ~6      $4, $5
          9        OP_DATA                                                      !1
         10        ECHO                                                         ~6
   13    11        FRAMELESS_ICALL_2                strtr               ~7      !1, !0
         12        ECHO                                                         ~7
   14    13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.52 ms | 1107 KiB | 15 Q