3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatFieldKey($key_raw) { $re = '/([\w]+)/$1/'; $key = explode('_', $key_raw); print_r($key); $final_key = array(); foreach ($key as $word) { array_push(preg_replace('/(\b[a-z]{1})/', strtoupper(${1}), $word), $final_key); } return $final_key; } echo formatFieldKey('field_some_request');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/521Ep
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'formatfieldkey'
          1        SEND_VAL                                                 'field_some_request'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function formatfieldkey:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/521Ep
function name:  formatFieldKey
number of ops:  29
compiled vars:  !0 = $key_raw, !1 = $re, !2 = $key, !3 = $final_key, !4 = $word, !5 = $1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '%2F%28%5B%5Cw%5D%2B%29%2F%241%2F'
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '_'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
    9    10        ASSIGN                                                   !3, <array>
   10    11      > FE_RESET_R                                       $11     !2, ->26
         12    > > FE_FETCH_R                                               $11, !4, ->26
   11    13    >   INIT_FCALL                                               'array_push'
         14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%28%5Cb%5Ba-z%5D%7B1%7D%29%2F'
         16        INIT_FCALL                                               'strtoupper'
         17        SEND_VAR                                                 !5
         18        DO_ICALL                                         $12     
         19        SEND_VAR                                                 $12
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $13     
         22        SEND_VAR_NO_REF                               0          $13
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   10    25      > JMP                                                      ->12
         26    >   FE_FREE                                                  $11
   14    27      > RETURN                                                   !3
   15    28*     > RETURN                                                   null

End of function formatfieldkey

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1018 KiB | 19 Q