3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = [ 'a' => '1', 'b' => '1', 'c' => '2', ]; $bar = array_map(function($v) { return '#' . $v; }, array_combine(array_keys($foo), array_keys($foo))); $foo_new = array_combine($bar, $foo); var_dump($foo_new);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PO2EC
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo, !1 = $bar, !2 = $foo_new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPO2EC%3A9%240'
   11     3        SEND_VAL                                                 ~4
          4        INIT_FCALL                                               'array_combine'
          5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        INIT_FCALL                                               'array_keys'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
    9    16        ASSIGN                                                   !1, $8
   13    17        INIT_FCALL                                               'array_combine'
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !2, $10
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPO2EC%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PO2EC
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        CONCAT                                           ~1      '%23', !0
          2      > RETURN                                                   ~1
   11     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPO2EC%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.23 ms | 1388 KiB | 21 Q