Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Laravel 8.x and PHP 8.1 or 8.2 ?

Hello,

Has somebody tested Laravel 8.x with PHP 8.1 or 8.2 ?

Thanks for your answer ;).

V

0 likes
8 replies
jlrdw's avatar

8.2, but why not the latest laravel version?

1 like
vincent15000's avatar

@jlrdw Well ... the app is already developed with Laravel 8.12 and I want to propose to upgrade the app to Laravel 9.x, perhaps 10.x (release in february), but it depends on other dependencies. I have to check all.

webrobert's avatar

it works. php 8 is all that is required "php": "^7.3|^8.0",

1 like
vincent15000's avatar

@webrobert I have tested Laravel 8.12 with PHP 8.1 and it doesn't work, I get this error.

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/vincent/Documents/PRO/DEV/KARINE/lbpf/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:1411
webrobert's avatar
Level 51

ok, php 8.1 and laravel 8.65 working just fine

1 like
vincent15000's avatar

@webrobert Is it a good idea to upgrade Laravel 8.12 to 8.65 ? As it's a minor version, it shouldn't disturb the current code or ? I will create a test branch and I will test the upgrade.

1 like

Please or to participate in this conversation.