3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); header("Content-Type: text/plain; charset=utf-8"); mb_internal_encoding('utf-8'); $text = "ну что. не смотрел еще black mesa.я собирался скачать ,но все как-то некогда было."; function makeFirstLetterUppercase($sentences) { $array = []; foreach ($sentences as $part) { $array[] = mb_strtoupper(mb_substr($part, 0, 1)) . mb_substr($part, 1); } return $array; } function fixText($text) { return preg_replace("/[ ]*([\.,;:!?]+)[ ]*/ui", "$1 ", $text); } $text = preg_split("/(?<=[\.!?])/ui", $text); $text = makeFirstLetterUppercase($text); $text = implode($text); $text = fixText($text); print_r($text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IM8gm
function name:  (null)
number of ops:  31
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'header'
          4        SEND_VAL                                                 'Content-Type%3A+text%2Fplain%3B+charset%3Dutf-8'
          5        DO_ICALL                                                 
    4     6        INIT_FCALL                                               'mb_internal_encoding'
          7        SEND_VAL                                                 'utf-8'
          8        DO_ICALL                                                 
    6     9        ASSIGN                                                   !0, '%D0%BD%D1%83+%D1%87%D1%82%D0%BE.++++++%D0%BD%D0%B5+%D1%81%D0%BC%D0%BE%D1%82%D1%80%D0%B5%D0%BB+%D0%B5%D1%89%D0%B5+black+mesa.%D1%8F+%D1%81%D0%BE%D0%B1%D0%B8%D1%80%D0%B0%D0%BB%D1%81%D1%8F+%D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C++%2C%D0%BD%D0%BE+%D0%B2%D1%81%D0%B5+%D0%BA%D0%B0%D0%BA-%D1%82%D0%BE+%D0%BD%D0%B5%D0%BA%D0%BE%D0%B3%D0%B4%D0%B0+%D0%B1%D1%8B%D0%BB%D0%BE.'
   21    10        INIT_FCALL                                               'preg_split'
         11        SEND_VAL                                                 '%2F%28%3F%3C%3D%5B%5C.%21%3F%5D%29%2Fui'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        ASSIGN                                                   !0, $5
   22    15        INIT_FCALL                                               'makefirstletteruppercase'
         16        SEND_VAR                                                 !0
         17        DO_FCALL                                      0  $7      
         18        ASSIGN                                                   !0, $7
   23    19        INIT_FCALL                                               'implode'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $9      
         22        ASSIGN                                                   !0, $9
   24    23        INIT_FCALL                                               'fixtext'
         24        SEND_VAR                                                 !0
         25        DO_FCALL                                      0  $11     
         26        ASSIGN                                                   !0, $11
   26    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function makefirstletteruppercase:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/IM8gm
function name:  makeFirstLetterUppercase
number of ops:  23
compiled vars:  !0 = $sentences, !1 = $array, !2 = $part
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !1, <array>
   11     2      > FE_RESET_R                                       $4      !0, ->20
          3    > > FE_FETCH_R                                               $4, !2, ->20
   12     4    >   INIT_FCALL                                               'mb_strtoupper'
          5        INIT_FCALL                                               'mb_substr'
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        INIT_FCALL                                               'mb_substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $8      
         16        CONCAT                                           ~9      $7, $8
         17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  ~9
   11    19      > JMP                                                      ->3
         20    >   FE_FREE                                                  $4
   14    21      > RETURN                                                   !1
   15    22*     > RETURN                                                   null

End of function makefirstletteruppercase

Function fixtext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IM8gm
function name:  fixText
number of ops:  8
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B+%5D%2A%28%5B%5C.%2C%3B%3A%21%3F%5D%2B%29%5B+%5D%2A%2Fui'
          3        SEND_VAL                                                 '%241+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   20     7*     > RETURN                                                   null

End of function fixtext

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.15 ms | 1407 KiB | 33 Q