3v4l.org

run code in 300+ PHP versions simultaneously
<?php function underscoreToCamel ($str) { // Remove underscores, capitalize words, squash, lowercase first. return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $str)))); } echo underscoreToCamel('my_variable_name');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBHPd
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'underscoretocamel'
          1        SEND_VAL                                                 'my_variable_name'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function underscoretocamel:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBHPd
function name:  underscoreToCamel
number of ops:  19
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'lcfirst'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+'
          4        SEND_VAL                                                 ''
          5        INIT_FCALL                                               'ucwords'
          6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '_'
          8        SEND_VAL                                                 '+'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $1      
         11        SEND_VAR                                                 $1
         12        DO_ICALL                                         $2      
         13        SEND_VAR                                                 $2
         14        DO_ICALL                                         $3      
         15        SEND_VAR                                                 $3
         16        DO_ICALL                                         $4      
         17      > RETURN                                                   $4
    6    18*     > RETURN                                                   null

End of function underscoretocamel

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.75 ms | 1402 KiB | 20 Q