3v4l.org

run code in 300+ PHP versions simultaneously
<?php function camelCase($string) { //preg_replace('/[^a-zA-Z0-9]/', '', ucwords(str_replace('/',' ',strtolower($string)))); //return preg_replace_callback('/\/[a-zA-Z9-0]/', function($matches){return strtoupper($matches[0][1]);}, $string); return preg_replace_callback('/\/[a-zA-Z9-0]/', function($matches){return ucword($matches[0]);}, $string); return $string; } echo camelCase('common/home');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/otsia
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'camelcase'
          1        SEND_VAL                                                 'common%2Fhome'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function camelcase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/otsia
function name:  camelCase
number of ops:  10
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%5C%2F%5Ba-zA-Z9-0%5D%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fotsia%3A6%240'
          4        SEND_VAL                                                 ~1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
    7     8*       RETURN                                                   !0
    8     9*     > RETURN                                                   null

End of function camelcase

Function %00%7Bclosure%7D%2Fin%2Fotsia%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/otsia
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        INIT_FCALL_BY_NAME                                       'ucword'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_DIM_FUNC_ARG                               $1      !0, 0
          4        SEND_FUNC_ARG                                            $1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fotsia%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.24 ms | 1399 KiB | 16 Q