<?php
$classes = str_repeat('dum-class ', 100000);
$text = '<div><p class="' . $classes . '">Not a url.</p></div>';
$pcre_backtrack_limit = ini_get('pcre.backtrack_limit');
ini_set('pcre.backtrack_limit', 1);
$chunks = preg_split('/(<[^>]+?>)/is', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$preg_last_error = preg_last_error();
var_dump($preg_last_error);
var_dump($preg_last_error === PREG_NO_ERROR);
ini_set('pcre.backtrack_limit', $pcre_backtrack_limit);
- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.14
- int(0)
bool(true)
preferences:
156.58 ms | 406 KiB | 5 Q