3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'item1' => 'red', 'item2' => 'blue#foo#', 'item3' => 'green', 'item4' => 'white#foo2#', 'item5' => 'bla#foo3#ck', 'item6' => 'yellow#foo#', ]; $translations = [ '~#foo#~' => 'John', '~#foo2#~' => 'California', '~#foo3#~' => 'Cola', ]; var_export(preg_replace(array_keys($translations), $translations, $array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Et2D3
function name:  (null)
number of ops:  14
compiled vars:  !0 = $array, !1 = $translations
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'var_export'
          3        INIT_FCALL                                               'preg_replace'
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.67 ms | 1011 KiB | 16 Q