3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Store them as key/value pairs with the search and replacement strings $wordsList = [ 'frog' => 'sock', 'Nock' => 'crock', ]; $message = str_replace( array_keys($wordsList), // Get all keys as the search array $wordsList, // The replacements "frog frog Nock Nock" ); echo $message;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WsUdn
function name:  (null)
number of ops:  12
compiled vars:  !0 = $wordsList, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'str_replace'
    9     2        INIT_FCALL                                               'array_keys'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
   10     6        SEND_VAR                                                 !0
   11     7        SEND_VAL                                                 'frog+frog+Nock+Nock'
    8     8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
   14    10        ECHO                                                     !1
   15    11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
267.06 ms | 1074 KiB | 15 Q