3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rename_keys($array, $replacement_keys) { return array_combine($replacement_keys, $array); } $myarr = array("a" => 22, "b" => 144, "c" => 43); $newkeys = array("x","y","z"); print_r(rename_keys($myarr, $newkeys));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uN1ZF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $myarr, !1 = $newkeys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'rename_keys'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function rename_keys:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uN1ZF
function name:  rename_keys
number of ops:  8
compiled vars:  !0 = $array, !1 = $replacement_keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    5     7*     > RETURN                                                   null

End of function rename_keys

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.86 ms | 1013 KiB | 16 Q