3v4l.org

run code in 300+ PHP versions simultaneously
<?php $originalString = 'Her (III.1) was the age of 2 years and 11 months. (shoulder a 4/5)'; $findStringArray = array("age", "(III.1)", "2", "months", "4"); foreach($findStringArray as $key => $value) { $originalString = preg_replace('/(?<=^|[. ])'.preg_quote($value).'(?=[. ]|$)/i', "__", $originalString); } echo $originalString,"\n". PHP_EOL;
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/uXMgT
function name:  (null)
number of ops:  21
compiled vars:  !0 = $originalString, !1 = $findStringArray, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Her+%28III.1%29+was+the+age+of+2+years+and+11+months.+%28shoulder+a+4%2F5%29'
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $6      !1, ->17
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->17
          4    >   ASSIGN                                                   !3, ~7
    5     5        INIT_FCALL                                               'preg_replace'
          6        INIT_FCALL                                               'preg_quote'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        CONCAT                                           ~10     '%2F%28%3F%3C%3D%5E%7C%5B.+%5D%29', $9
         10        CONCAT                                           ~11     ~10, '%28%3F%3D%5B.+%5D%7C%24%29%2Fi'
         11        SEND_VAL                                                 ~11
         12        SEND_VAL                                                 '__'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !0, $12
    4    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
    7    18        ECHO                                                     !0
         19        ECHO                                                     '%0A%0A'
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
257.97 ms | 1395 KiB | 18 Q