3v4l.org

run code in 300+ 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 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/t6Bh7
function name:  (null)
number of ops:  20
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, ->17
          3    > > FE_FETCH_R                                               $5, !2, ->17
   11     4    >   INIT_FCALL                                               'preg_replace'
          5        CONCAT                                           ~6      '%2F%5Cb', !2
          6        CONCAT                                           ~7      ~6, '%5Cb%2Fu'
          7        SEND_VAL                                                 ~7
          8        INIT_FCALL                                               'mb_convert_case'
          9        SEND_VAR                                                 !2
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !0, $9
   10    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $5
   13    18        ECHO                                                     !0
   14    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
205.1 ms | 1400 KiB | 17 Q