3v4l.org

run code in 500+ 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:  13
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                                                   'ucwords'
          3        FRAMELESS_ICALL_3                str_replace         ~1      '_', '+'
          4        OP_DATA                                                      !0
          5        SEND_VAL                                                     ~1
          6        DO_ICALL                                             $2      
          7        FRAMELESS_ICALL_3                str_replace         ~3      '+', ''
          8        OP_DATA                                                      $2
          9        SEND_VAL                                                     ~3
         10        DO_ICALL                                             $4      
         11      > RETURN                                                       $4
    6    12*     > RETURN                                                       null

End of function underscoretocamel

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.44 ms | 3311 KiB | 16 Q