xref: /PHP-8.4/ext/pcre/tests/gh17122.phpt (revision dc27acdd)
1--TEST--
2GH-17122 (memory leak in regex)
3--FILE--
4<?php
5preg_match('|(?P<name>)(\d+)|', 0xffffffff, $m1);
6var_dump($m1);
7\preg_match('|(?P<name2>)(\d+)|', 0, $m2);
8var_dump($m2);
9?>
10--EXPECT--
11array(4) {
12  [0]=>
13  string(10) "4294967295"
14  ["name"]=>
15  string(0) ""
16  [1]=>
17  string(0) ""
18  [2]=>
19  string(10) "4294967295"
20}
21array(4) {
22  [0]=>
23  string(1) "0"
24  ["name2"]=>
25  string(0) ""
26  [1]=>
27  string(0) ""
28  [2]=>
29  string(1) "0"
30}
31