3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str="I am a string with several periods.period #1. period #2."; preg_match_all("/\.\s*\w/", $str, $matches); foreach($matches[0] as $match){ $str = str_replace($match, strtoupper($match), $str); } echo $str;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/LevU5
function name:  (null)
number of ops:  19
compiled vars:  !0 = $str, !1 = $matches, !2 = $match
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'I+am+a+string+with+several+periods.period+%231.+period+%232.'
    4     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%5C.%5Cs%2A%5Cw%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    6     6        FETCH_DIM_R                                          ~5      !1, 0
          7      > FE_RESET_R                                           $6      ~5, ->16
          8    > > FE_FETCH_R                                                   $6, !2, ->16
    7     9    >   INIT_FCALL                                                   'strtoupper'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                             $7      
         12        FRAMELESS_ICALL_3                str_replace         ~8      !2, $7
         13        OP_DATA                                                      !0
         14        ASSIGN                                                       !0, ~8
    6    15      > JMP                                                          ->8
         16    >   FE_FREE                                                      $6
    9    17        ECHO                                                         !0
   10    18      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.84 ms | 2635 KiB | 15 Q