We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 56d515a + 4e83123 commit fa3c8eeCopy full SHA for fa3c8ee
ext/pcre/tests/preg_match_frameless_leak.phpt
@@ -5,7 +5,7 @@ Memory leak in preg_match() frameless function with invalid regex and object arg
5
class Str {
6
private $val;
7
public function __construct($val) {
8
- $this->val = $val;
+ $this->val = str_repeat($val, random_int(1, 1));
9
}
10
public function __toString() {
11
return $this->val;
@@ -15,10 +15,7 @@ class Str {
15
$regex = new Str("invalid regex");
16
$subject = new Str("some subject");
17
18
-// Running in a loop to ensure leak detection if run with memory tools
19
-for ($i = 0; $i < 100; $i++) {
20
- @preg_match($regex, $subject);
21
-}
+@preg_match($regex, $subject);
22
23
echo "Done";
24
?>
0 commit comments