3v4l.org

run code in 500+ 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:/in/sbqED:14}
number of ops:  12
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
   16     2        INIT_FCALL                                                   'array_keys'
          3        SEND_VAR                                                     !1
          4        DO_ICALL                                             $2      
   17     5        INIT_FCALL                                                   'array_values'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $3      
   15     8        FRAMELESS_ICALL_3                str_replace         ~4      $2, $3
   18     9        OP_DATA                                                      !0
         10      > RETURN                                                       ~4
   20    11*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
175.29 ms | 2011 KiB | 18 Q