about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaude Sonnet 52026-08-17 19:07:30 +0000
committerFrederick Muriuki Muriithi2026-08-17 14:52:12 -0500
commit55909cd3cadfd070cd157e78ec2364613ed8ab58 (patch)
treeb4bc4cc6f10a2adf31477b2b3f3ea0f9261a2323
parente9a320d0ee9c66001da2523d8eef339e63e0c13c (diff)
downloadBNW-55909cd3cadfd070cd157e78ec2364613ed8ab58.tar.gz
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 <fredmanglis@gmail.com>
-rw-r--r--sourcecodes/runtime_check.php2
1 files changed, 0 insertions, 2 deletions
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;