3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'GRANDE ÁRVORE'; function capitalize($string) { if (mb_detect_encoding($string) === 'UTF-8') { $string = mb_convert_case(utf8_encode($string), MB_CASE_TITLE, 'UTF-8'); } else { $string = mb_convert_case($string, MB_CASE_TITLE, 'UTF-8'); } return $string; } echo capitalize($str); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iW6AO
function name:  (null)
number of ops:  6
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'GRANDE+%C3%81RVORE'
   15     1        INIT_FCALL                                               'capitalize'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   17     5      > RETURN                                                   1

Function capitalize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iW6AO
function name:  capitalize
number of ops:  24
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'mb_detect_encoding'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        IS_IDENTICAL                                             $1, 'UTF-8'
          5      > JMPZ                                                     ~2, ->16
    8     6    >   INIT_FCALL                                               'mb_convert_case'
          7        INIT_FCALL                                               'utf8_encode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        SEND_VAL                                                 2
         12        SEND_VAL                                                 'UTF-8'
         13        DO_ICALL                                         $4      
         14        ASSIGN                                                   !0, $4
         15      > JMP                                                      ->22
   10    16    >   INIT_FCALL                                               'mb_convert_case'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 2
         19        SEND_VAL                                                 'UTF-8'
         20        DO_ICALL                                         $6      
         21        ASSIGN                                                   !0, $6
   12    22    > > RETURN                                                   !0
   13    23*     > RETURN                                                   null

End of function capitalize

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.88 ms | 1390 KiB | 20 Q