I have a cycle, but sometimes it goes into infinite execution. Is it possible to somehow make it so that if the cycle is performed longer than 2х секунд then change the variables $l_dict and $r_dict to $l_dict = 'dict' and $r_dict = 'dict'
do { $word_1 = changeRegister($l_dict); $word_2 = changeRegister($r_dict); $check = checkUpperRegister($word_1) && checkUpperRegister($word_2); } while ($check); $summa = $p_1.$word_1.$p_2.$word_2.$p_3; $password = preg_replace('/\s+/u', '', $summa); $check_lentgh = mb_strlen($password, 'UTF-8') == $glength; } while (!$check_lentgh);