3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dashesToCamelCase($string, $capitalizeFirstCharacter = false) { $str = str_replace(' ', '', ucwords(str_replace('-', ' ', $string))); return $str; } echo dashesToCamelCase('this-is-a-string');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U5bmF
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'dashestocamelcase'
          1        SEND_VAL                                                 'this-is-a-string'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function dashestocamelcase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U5bmF
function name:  dashesToCamelCase
number of ops:  18
compiled vars:  !0 = $string, !1 = $capitalizeFirstCharacter, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
    6     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                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !2, $5
    8    16      > RETURN                                                   !2
    9    17*     > RETURN                                                   null

End of function dashestocamelcase

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.51 ms | 1398 KiB | 18 Q