3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "blah blarh"; $searchReplaceArray = array( 'blah' => 'bleh', 'blarh' => 'blerh' ); $result = str_replace( array_keys($searchReplaceArray), array_values($searchReplaceArray), $string ); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMZqI
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $searchReplaceArray, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'blah+blarh'
    4     1        ASSIGN                                                   !1, <array>
    8     2        INIT_FCALL                                               'str_replace'
    9     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
   10     7        INIT_FCALL                                               'array_values'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
   11    11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
    8    13        ASSIGN                                                   !2, $7
   14    14        ECHO                                                     !2
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.14 ms | 1394 KiB | 19 Q