3v4l.org

run code in 500+ PHP versions simultaneously
<?php $result = 'вы ещё дома? давайте выходите!вам пришел ваш конверт!!!1'; $wordsArr = [ "вы", "вам", "ваш", "вас" ]; foreach($wordsArr as $word) { $result = preg_replace('/\b' . $word . '\b/u', mb_convert_case($word, MB_CASE_TITLE), $result); } echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/t6Bh7
function name:  (null)
number of ops:  17
compiled vars:  !0 = $result, !1 = $wordsArr, !2 = $word
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%D0%B2%D1%8B+%D0%B5%D1%89%D1%91+%D0%B4%D0%BE%D0%BC%D0%B0%3F+%D0%B4%D0%B0%D0%B2%D0%B0%D0%B9%D1%82%D0%B5+%D0%B2%D1%8B%D1%85%D0%BE%D0%B4%D0%B8%D1%82%D0%B5%21%D0%B2%D0%B0%D0%BC+%D0%BF%D1%80%D0%B8%D1%88%D0%B5%D0%BB+%D0%B2%D0%B0%D1%88+%D0%BA%D0%BE%D0%BD%D0%B2%D0%B5%D1%80%D1%82%21%21%211'
    4     1        ASSIGN                                                       !1, <array>
   10     2      > FE_RESET_R                                           $5      !1, ->14
          3    > > FE_FETCH_R                                                   $5, !2, ->14
   11     4    >   CONCAT                                               ~6      '%2F%5Cb', !2
          5        CONCAT                                               ~7      ~6, '%5Cb%2Fu'
          6        INIT_FCALL                                                   'mb_convert_case'
          7        SEND_VAR                                                     !2
          8        SEND_VAL                                                     2
          9        DO_ICALL                                             $8      
         10        FRAMELESS_ICALL_3                preg_replace        ~9      ~7, $8
         11        OP_DATA                                                      !0
         12        ASSIGN                                                       !0, ~9
   10    13      > JMP                                                          ->3
         14    >   FE_FREE                                                      $5
   13    15        ECHO                                                         !0
   14    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.12 ms | 2513 KiB | 9 Q