From 55909cd3cadfd070cd157e78ec2364613ed8ab58 Mon Sep 17 00:00:00 2001 From: Claude Sonnet 5 Date: Mon, 17 Aug 2026 19:07:30 +0000 Subject: Remove orphaned fwrite() call in runtime_check.php that crashes on PHP 8 $fprows and $lc were never defined anywhere in exe_time(). On PHP 7.4 fwrite() with a null resource argument just emitted warnings and returned false. On PHP 8+, fwrite() requires a resource/false is no longer coerced, so this throws an uncaught TypeError on every call, crashing any page that invokes exe_time() (progress-tracking pages). Verified empirically against PHP 8.3.28: before the fix, calling exe_time() throws TypeError: fwrite(): Argument #1 ($stream) must be of type resource, null given after the fix it returns the computed runtime estimate as before. Reviewed by: Frederick M Muriithi --- sourcecodes/runtime_check.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'sourcecodes/runtime_check.php') diff --git a/sourcecodes/runtime_check.php b/sourcecodes/runtime_check.php index 300a197f..7b468957 100644 --- a/sourcecodes/runtime_check.php +++ b/sourcecodes/runtime_check.php @@ -10,8 +10,6 @@ function exe_time($keyval,$parent_number,$k_number) $nrf = $dir.$keyval."nrows.txt"; $nrows=trim(file_get_contents("$nrf")); -fwrite($fprows,"$lc\n"); - $nf=$dir.$keyval."nnode.txt"; $node=trim(file_get_contents("$nf"))-1; $parent_number=$parent_number-1; -- cgit 1.4.1