3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "моя строка"; $encoding = "UTF-8"; $first_letter = mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding); $str = $first_letter . mb_substr($str, 1, mb_strlen($str, $encoding), $encoding); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC9Ug
function name:  (null)
number of ops:  27
compiled vars:  !0 = $str, !1 = $encoding, !2 = $first_letter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D0%BC%D0%BE%D1%8F+%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B0'
    4     1        ASSIGN                                                   !1, 'UTF-8'
    6     2        INIT_FCALL                                               'mb_strtoupper'
          3        INIT_FCALL                                               'mb_substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !2, $6
    8    13        INIT_FCALL                                               'mb_substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 1
         16        INIT_FCALL                                               'mb_strlen'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $9      
         23        CONCAT                                           ~10     !2, $9
         24        ASSIGN                                                   !0, ~10
   10    25        ECHO                                                     !0
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.19 ms | 1395 KiB | 19 Q