3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = array( 'a' => 1, 'b' => '1', 'c' => 1, '1' => '2', 1 => 2, ); function change_keys($array, $callback) { return array_combine(array_map($callback, array_combine(array_keys($array), array_keys($array))), $array); } var_dump(change_keys($foo, function($v) { return '#' . $v; }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qi8qn
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'change_keys'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fqi8qn%3A12%240'
   14     5        SEND_VAL                                                 ~2
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function change_keys:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qi8qn
function name:  change_keys
number of ops:  22
compiled vars:  !0 = $array, !1 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'array_combine'
          3        INIT_FCALL                                               'array_map'
          4        SEND_VAR                                                 !1
          5        INIT_FCALL                                               'array_combine'
          6        INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        INIT_FCALL                                               'array_keys'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $6      
         20      > RETURN                                                   $6
   11    21*     > RETURN                                                   null

End of function change_keys

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

End of function %00%7Bclosure%7D%2Fin%2Fqi8qn%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.96 ms | 1394 KiB | 22 Q