3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = array( 'a' => '1', 'b' => 1, 'c' => 1, '1' => '2', 1 => 2, ); var_dump($foo); 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/shTeG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   14     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'change_keys'
          6        SEND_VAR                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FshTeG%3A14%240'
   16     8        SEND_VAL                                                 ~3
          9        DO_FCALL                                      0  $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function change_keys:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/shTeG
function name:  change_keys
number of ops:  22
compiled vars:  !0 = $array, !1 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     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
   13    21*     > RETURN                                                   null

End of function change_keys

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

End of function %00%7Bclosure%7D%2Fin%2FshTeG%3A14%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.73 ms | 1402 KiB | 22 Q