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/jMqh1
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/jMqh1
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      
    5     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%2FjMqh1%3A5%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%2FjMqh1%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jMqh1
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strtoupper'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        FETCH_DIM_R                                      ~2      ~1, 1
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FjMqh1%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.77 ms | 1399 KiB | 18 Q