Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional deprecation notices under PHP 8.4 #81

Open
Marian-Kechlibar opened this issue Dec 6, 2024 · 0 comments
Open

Occasional deprecation notices under PHP 8.4 #81

Marian-Kechlibar opened this issue Dec 6, 2024 · 0 comments

Comments

@Marian-Kechlibar
Copy link

Version: 3.3.1

PHP version: 8.4.1

Bug Description

Warning: unserialize(): Error at offset 0 of 26 bytes in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 306

Deprecated: Automatic conversion of false to array is deprecated in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 307

Warning: unserialize(): Error at offset 0 of 3 bytes in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 306

Deprecated: Automatic conversion of false to array is deprecated in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 307

Warning: unserialize(): Error at offset 0 of 26 bytes in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 306

Deprecated: Automatic conversion of false to array is deprecated in /var/www/html/vendor/nette/caching/src/Caching/Storages/FileStorage.php on line 307

Notice: Possible problem: you are sending a HTTP header while already having some data in output buffer. Try Tracy\OutputDebugger or send cookies/start session earlier. in /var/www/html/vendor/nette/http/src/Http/Response.php on line 279

Steps To Reproduce

Happens occasionally on my production server, but the problem seems to be syntax-centered. The code around the problem is as follows:


		$size = (int) stream_get_contents($handle, self::MetaHeaderLen);
		if ($size) {
			$meta = stream_get_contents($handle, $size, self::MetaHeaderLen);
			$meta = unserialize($meta);
			$meta[self::File] = $file;
			$meta[self::Handle] = $handle;
			return $meta;
		}

unserialize may return false, in which case the $meta variable shouldn't be be treated as an array. PHP's unserialize is a bit of a cursed function, though. Not very reliable.

Expected Behavior

No warnings.

Possible Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant