3v4l.org

run code in 300+ PHP versions simultaneously
<?php function titleCaseSpecial($string) { return preg_replace_callback( '~[/.-]\p{Ll}~u', function ($m) { return mb_strtoupper($m[0], 'UTF-8'); }, mb_convert_case($string, MB_CASE_TITLE, 'UTF-8') ); } $strings = [ 'Name: MR. M.A.D KARIM', 'Address: 12/A, ROOM NO-B 13' ]; var_export( array_map('titleCaseSpecial', $strings) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pvCjU
function name:  (null)
number of ops:  9
compiled vars:  !0 = $strings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   19     1        INIT_FCALL                                               'var_export'
   20     2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'titleCaseSpecial'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
   19     7        DO_ICALL                                                 
   21     8      > RETURN                                                   1

Function titlecasespecial:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pvCjU
function name:  titleCaseSpecial
number of ops:  14
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'
    6     2        SEND_VAL                                                 '%7E%5B%2F.-%5D%5Cp%7BLl%7D%7Eu'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    9     4        SEND_VAL                                                 ~1
   10     5        INIT_FCALL                                               'mb_convert_case'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 2
          8        SEND_VAL                                                 'UTF-8'
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
    5    11        DO_ICALL                                         $3      
   10    12      > RETURN                                                   $3
   12    13*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pvCjU
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'mb_strtoupper'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 'UTF-8'
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    9     7*     > RETURN                                                   null

End of Dynamic Function 0

End of function titlecasespecial

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.36 ms | 1003 KiB | 18 Q