Skip to content

Commit 47c80af

Browse files
authored
Fix deprecation for PHP 8+
shmop_close function has been DEPRECATED as of PHP 8.0.0.
1 parent f8a99a9 commit 47c80af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Database.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ public function __construct($file = null, $mode = self::FILE_IO)
581581
shmop_write($shmId, $buf, $pointer);
582582
$pointer += self::SHM_CHUNK_SIZE;
583583
}
584-
shmop_close($shmId);
584+
if (PHP_MAJOR_VERSION < 8) {
585+
shmop_close($shmId);
586+
}
585587
fclose($fp);
586588

587589
// now open the memory segment for readonly access

0 commit comments

Comments
 (0)