diff --git a/typo3/sysext/core/Classes/Service/AbstractService.php b/typo3/sysext/core/Classes/Service/AbstractService.php
index 0f89c57c668e1cc43070af05a8d50cdd3cb1ee6c..b682de93702af9c9f708d6f7a826e53880f676c0 100644
--- a/typo3/sysext/core/Classes/Service/AbstractService.php
+++ b/typo3/sysext/core/Classes/Service/AbstractService.php
@@ -329,7 +329,7 @@ abstract class AbstractService implements LoggerAwareInterface
      *
      * @param string $absFile File name to read from.
      * @param int $length Maximum length to read. If empty the whole file will be read.
-     * @return string|bool $content or FALSE
+     * @return string|bool file content or false
      */
     public function readFile($absFile, $length = 0)
     {
@@ -354,8 +354,12 @@ abstract class AbstractService implements LoggerAwareInterface
     {
         if (!$absFile) {
             $absFile = $this->tempFile($this->prefixId);
+            if ($absFile === false) {
+                return false;
+            }
+            $absFile = (string)$absFile;
         }
-        if ($absFile && GeneralUtility::isAllowedAbsPath($absFile)) {
+        if (GeneralUtility::isAllowedAbsPath($absFile)) {
             if ($fd = @fopen($absFile, 'wb')) {
                 @fwrite($fd, $content);
                 @fclose($fd);
@@ -446,7 +450,7 @@ abstract class AbstractService implements LoggerAwareInterface
      * Get the input content.
      * Will be read from input file if needed. (That is if ->inputContent is empty and ->inputFile is not)
      *
-     * @return mixed
+     * @return string|bool
      */
     public function getInput()
     {
@@ -481,7 +485,7 @@ abstract class AbstractService implements LoggerAwareInterface
     /**
      * Set the output file name.
      *
-     * @param string $absFile File name
+     * @param string|bool $absFile File name
      */
     public function setOutputFile($absFile)
     {
@@ -491,7 +495,7 @@ abstract class AbstractService implements LoggerAwareInterface
     /**
      * Get the output content.
      *
-     * @return mixed
+     * @return string
      */
     public function getOutput()
     {
diff --git a/typo3/sysext/core/Classes/Service/Archive/ZipService.php b/typo3/sysext/core/Classes/Service/Archive/ZipService.php
index 02e1e834b098e90ab68769d05c52371290253114..0681a6aacbf6f59cd2f37f5aeab62b4e5a83001b 100644
--- a/typo3/sysext/core/Classes/Service/Archive/ZipService.php
+++ b/typo3/sysext/core/Classes/Service/Archive/ZipService.php
@@ -73,7 +73,7 @@ class ZipService
         }
 
         for ($i = 0; $i < $zip->numFiles; $i++) {
-            $entryName = $zip->getNameIndex($i);
+            $entryName = (string)$zip->getNameIndex($i);
             if (preg_match('#/(?:\.{2,})+#', $entryName) // Contains any traversal sequence starting with a slash, e.g. /../, /.., /.../
                 || preg_match('#^(?:\.{2,})+/#', $entryName) // Starts with a traversal sequence, e.g. ../, .../
             ) {
diff --git a/typo3/sysext/core/Classes/Service/OpcodeCacheService.php b/typo3/sysext/core/Classes/Service/OpcodeCacheService.php
index 399967fda9f0df0a8ee5f0a190e8737f392450c1..2e9eb76cfb0cf43b363a7aa0850231868f372786 100644
--- a/typo3/sysext/core/Classes/Service/OpcodeCacheService.php
+++ b/typo3/sysext/core/Classes/Service/OpcodeCacheService.php
@@ -74,7 +74,7 @@ class OpcodeCacheService
      */
     protected static function isClearable(): bool
     {
-        $disabled = explode(',', ini_get('disable_functions'));
+        $disabled = explode(',', (string)ini_get('disable_functions'));
         return !(in_array('opcache_invalidate', $disabled, true) || in_array('opcache_reset', $disabled, true));
     }
 }