Obtained from:	https://github.com/laruence/yar/pull/177

--- tests/yar.inc.orig	2022-05-18 05:52:56 UTC
+++ tests/yar.inc
@@ -105,17 +105,19 @@ PHP;
 
 function yar_server_cleanup() {
 	$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "htdocs";
-	$dp = opendir($dir);
-	while (($f = readdir($dp))) {
-		if (in_array($f, array('.', '..'))) {
-			continue;
+	if (is_dir($dir)) {
+		$dp = opendir($dir);
+		while (($f = readdir($dp))) {
+			if (in_array($f, array('.', '..'))) {
+				continue;
+			}
+			$path = $dir . DIRECTORY_SEPARATOR . $f;
+			if (is_file($path)) {
+				unlink($path);
+			}
 		}
-		$path = $dir . DIRECTORY_SEPARATOR . $f;
-		if (is_file($path)) {
-			unlink($path);
-		}
+		rmdir($dir);
 	}
-	rmdir($dir);
 }
 
 /* For TCP */
--- yar_request.c.orig	2022-05-18 05:52:56 UTC
+++ yar_request.c
@@ -34,7 +34,11 @@
 yar_request_t *php_yar_request_instance(zend_string *method, zend_array *parameters, void **options) /* {{{ */ {
 	yar_request_t *request = emalloc(sizeof(yar_request_t));
 
+#if PHP_VERSION_ID < 80200
 	if (!BG(mt_rand_is_seeded)) {
+#else
+	if (!RANDOM_G(mt19937_seeded)) {
+#endif
 		php_mt_srand(GENERATE_SEED());
 	}
 
