3v4l.org

run code in 500+ PHP versions simultaneously
<?php $x = [ 'PascalCase' => 'camelCase', 'PascalCase2' => 'camelCase2', ]; // Lets convert the PascalCase keys to camelCase $arr = array_combine( array_map(function($k) { return lcfirst($k); }, array_keys($x)), array_values($x) ); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HABl7
function name:  (null)
number of ops:  21
compiled vars:  !0 = $x, !1 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    9     1        INIT_FCALL                                                   'array_combine'
   10     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   12     4        SEND_VAL                                                     ~3
          5        INIT_FCALL                                                   'array_keys'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $4      
          8        SEND_VAR                                                     $4
   10     9        DO_ICALL                                             $5      
   12    10        SEND_VAR                                                     $5
   13    11        INIT_FCALL                                                   'array_values'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                             $6      
         14        SEND_VAR                                                     $6
    9    15        DO_ICALL                                             $7      
         16        ASSIGN                                                       !1, $7
   16    17        INIT_FCALL                                                   'var_dump'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                                     
         20      > 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/HABl7
function name:  {closure:/in/HABl7:10}
number of ops:  6
compiled vars:  !0 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        INIT_FCALL                                                   'lcfirst'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $1      
          4      > RETURN                                                       $1
   12     5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
217 ms | 1875 KiB | 19 Q