3v4l.org

run code in 500+ PHP versions simultaneously
<?php $values = [ 'not-valid-holidays', '$-holidays', '2009--holidays', '2009-A-holidays', '20091-holidays', '2009-999-holidays', 'test/99-holidays', 'test/99/test-holidays', '190-20-holidays', '0-0-holidays', '99-0-holidays', '0-99-holidays', '9999-99-holidays', '2004-holidays', ]; $patterns = [ '.+', '[-\w]+', '[-\d]+', '\d{1,4}(-\d{1,2})?' ]; foreach ($patterns as $pattern) { echo 'Pattern: ' . $pattern . \PHP_EOL; foreach ($values as $string) { echo $string . ': ' . (preg_match('/^' . $pattern. '-holidays$/', $string) ? '✓' : 'X') . \PHP_EOL; } echo \PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/c712H
function name:  (null)
number of ops:  26
compiled vars:  !0 = $values, !1 = $patterns, !2 = $pattern, !3 = $string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   20     1        ASSIGN                                                       !1, <array>
   28     2      > FE_RESET_R                                           $6      !1, ->24
          3    > > FE_FETCH_R                                                   $6, !2, ->24
   29     4    >   CONCAT                                               ~7      'Pattern%3A+', !2
          5        CONCAT                                               ~8      ~7, '%0A'
          6        ECHO                                                         ~8
   30     7      > FE_RESET_R                                           $9      !0, ->21
          8    > > FE_FETCH_R                                                   $9, !3, ->21
   31     9    >   CONCAT                                               ~10     !3, '%3A+'
         10        CONCAT                                               ~11     '%2F%5E', !2
         11        CONCAT                                               ~12     ~11, '-holidays%24%2F'
         12        FRAMELESS_ICALL_2                preg_match          ~13     ~12, !3
         13      > JMPZ                                                         ~13, ->16
         14    >   QM_ASSIGN                                            ~14     '%E2%9C%93'
         15      > JMP                                                          ->17
         16    >   QM_ASSIGN                                            ~14     'X'
         17    >   CONCAT                                               ~15     ~10, ~14
         18        CONCAT                                               ~16     ~15, '%0A'
         19        ECHO                                                         ~16
   30    20      > JMP                                                          ->8
         21    >   FE_FREE                                                      $9
   33    22        ECHO                                                         '%0A'
   28    23      > JMP                                                          ->3
         24    >   FE_FREE                                                      $6
   34    25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
238.22 ms | 2354 KiB | 15 Q