3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings[] = 'ABC$item_#1_Value$QWERT'; $strings[] = 'ABC $ITEM_#1_VALUE$ QWERT'; $strings[] = 'ABC $item_#1_Value$ QWERT'; foreach ($strings as $string) { $string = preg_replace('/\s*\$item_#1_Value\$\s*/i', "1234", $string); echo $string.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/XW1AP
function name:  (null)
number of ops:  16
compiled vars:  !0 = $strings, !1 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                                   !0
          1        OP_DATA                                                      'ABC%24item_%231_Value%24QWERT'
    4     2        ASSIGN_DIM                                                   !0
          3        OP_DATA                                                      'ABC+%24ITEM_%231_VALUE%24++++++QWERT'
    5     4        ASSIGN_DIM                                                   !0
          5        OP_DATA                                                      'ABC+++++%24item_%231_Value%24+QWERT'
    6     6      > FE_RESET_R                                           $5      !0, ->14
          7    > > FE_FETCH_R                                                   $5, !1, ->14
    7     8    >   FRAMELESS_ICALL_3                preg_replace        ~6      '%2F%5Cs%2A%5C%24item_%231_Value%5C%24%5Cs%2A%2Fi', '1234'
          9        OP_DATA                                                      !1
         10        ASSIGN                                                       !1, ~6
    8    11        CONCAT                                               ~8      !1, '%0A'
         12        ECHO                                                         ~8
    6    13      > JMP                                                          ->7
         14    >   FE_FREE                                                      $5
    9    15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.81 ms | 2189 KiB | 13 Q