3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = [ "123456-12345", "12345678901", "12345678", "1312345678912", "12345678901", "1234567890123", "12345-12345", "1234567-12345", "123456", "12345678901234", "1234567890", "123456789088", "123456789-12345", "1111111111111111111" ]; $pattern = "/^(?:\d{6}-\d+|\d{8}|\d{11}|\d{13})$/"; foreach ($strings as $str) { if (preg_match($pattern, $str)) { echo "Match --> $str"; } else { echo "No match --> $str"; } echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/QFoH2
function name:  (null)
number of ops:  17
compiled vars:  !0 = $strings, !1 = $pattern, !2 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   19     1        ASSIGN                                                       !1, '%2F%5E%28%3F%3A%5Cd%7B6%7D-%5Cd%2B%7C%5Cd%7B8%7D%7C%5Cd%7B11%7D%7C%5Cd%7B13%7D%29%24%2F'
   20     2      > FE_RESET_R                                           $5      !0, ->15
          3    > > FE_FETCH_R                                                   $5, !2, ->15
   21     4    >   FRAMELESS_ICALL_2                preg_match          ~6      !1, !2
          5      > JMPZ                                                         ~6, ->10
   22     6    >   NOP                                                          
          7        FAST_CONCAT                                          ~7      'Match+--%3E+', !2
          8        ECHO                                                         ~7
   21     9      > JMP                                                          ->13
   24    10    >   NOP                                                          
         11        FAST_CONCAT                                          ~8      'No+match+--%3E+', !2
         12        ECHO                                                         ~8
   26    13    >   ECHO                                                         '%0A'
   20    14      > JMP                                                          ->3
         15    >   FE_FREE                                                      $5
   27    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
202.3 ms | 2090 KiB | 13 Q