3v4l.org

run code in 500+ 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:  9
compiled vars:  !0 = $wordsList, !1 = $message
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'array_keys'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $3      
    8     4        FRAMELESS_ICALL_3                str_replace         ~4      $3, !0
   11     5        OP_DATA                                                      'frog+frog+Nock+Nock'
    8     6        ASSIGN                                                       !1, ~4
   14     7        ECHO                                                         !1
   15     8      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
175.55 ms | 2027 KiB | 14 Q