3v4l.org

run code in 300+ PHP versions simultaneously
<?php $origin = ['value1', 'value2', 'value3', '-2', '2', '22']; $replace_map = [ 'value1' => 'replace1', 'value2' => 'replace2', 'value8' => 'replace8', 2 => 77 ]; var_export( array_map( function($value) use ($replace_map) { return str_replace( array_keys($replace_map), array_values($replace_map), $value ); }, $origin ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbqED
function name:  (null)
number of ops:  12
compiled vars:  !0 = $origin, !1 = $replace_map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'var_export'
   13     3        INIT_FCALL                                               'array_map'
   14     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   20     6        SEND_VAL                                                 ~4
   21     7        SEND_VAR                                                 !0
   13     8        DO_ICALL                                         $5      
   21     9        SEND_VAR                                                 $5
   12    10        DO_ICALL                                                 
   23    11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbqED
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $value, !1 = $replace_map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        INIT_FCALL                                               'str_replace'
   16     3        INIT_FCALL                                               'array_keys'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
   17     7        INIT_FCALL                                               'array_values'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
   18    11        SEND_VAR                                                 !0
   15    12        DO_ICALL                                         $4      
   18    13      > RETURN                                                   $4
   20    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.37 ms | 1004 KiB | 18 Q