3v4l.org

run code in 500+ PHP versions simultaneously
<?php $pattern = "/\by\K\d(?=[\h\p{L}.]|$)/"; $strings = [ "y0", "y1$", "y2H", "y3.", "y9 ", "y10", "y09 y3 ay9" ]; foreach ($strings as $s) { echo preg_replace($pattern, "0$0", $s) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/sDScE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $pattern, !1 = $strings, !2 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2F%5Cby%5CK%5Cd%28%3F%3D%5B%5Ch%5Cp%7BL%7D.%5D%7C%24%29%2F'
    4     1        ASSIGN                                                       !1, <array>
   14     2      > FE_RESET_R                                           $5      !1, ->9
          3    > > FE_FETCH_R                                                   $5, !2, ->9
   15     4    >   FRAMELESS_ICALL_3                preg_replace        ~6      !0, '0%240'
          5        OP_DATA                                                      !2
          6        CONCAT                                               ~7      ~6, '%0A'
          7        ECHO                                                         ~7
   14     8      > JMP                                                          ->3
          9    >   FE_FREE                                                      $5
   16    10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.38 ms | 473 KiB | 7 Q