Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ext/pcre/tests/preg_match_frameless_leak.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Memory leak in preg_match() frameless function with invalid regex and object arg
class Str {
private $val;
public function __construct($val) {
$this->val = $val;
$this->val = str_repeat($val, random_int(1, 1));
}
public function __toString() {
return $this->val;
Expand All @@ -15,10 +15,7 @@ class Str {
$regex = new Str("invalid regex");
$subject = new Str("some subject");

// Running in a loop to ensure leak detection if run with memory tools
for ($i = 0; $i < 100; $i++) {
@preg_match($regex, $subject);
}
@preg_match($regex, $subject);

echo "Done";
?>
Expand Down
Loading