Search Sign in Write for us
PROMPTPOST

Software

Which PHP Version Should You Use in 2026? A Practical Guide for Laravel and WordPress

PHP 8.6 is out, 8.2 is about to lose support, and hosts don't all offer the newest release. Here's how to pick without breaking your site.

PromptPost Desk 5 min read
X Facebook LinkedIn
Published
A row of ascending stepping stones glowing brighter toward the newest one
A row of ascending stepping stones glowing brighter toward the newest one AI-generated image

Choosing a PHP version used to mean "whatever the host set". Now the gap between releases matters: older versions stop getting security fixes, and newer ones need your framework and plugins to keep up. Here's how to decide.

PHP support dates at a glance

Each PHP version gets about two years of active support (bug and security fixes), then two years of security fixes only.

VersionSecurity support ends
PHP 8.1Already ended
PHP 8.231 December 2026
PHP 8.331 December 2027
PHP 8.431 December 2028
PHP 8.531 December 2029
PHP 8.631 December 2030

The key point: running an old major version is fine only while it still gets patches. Once it doesn't, every new flaw stays open. The recent PHP security updates show why this matters.

What's new in PHP 8.6

PHP 8.6.0 was released on 19 November 2026. Highlights include:

  • Partial function application, which lets you fix some arguments of a function and get back a new callable.

  • A clamp() function to keep a number within a minimum and maximum.

  • A \Time\Duration class for working with time spans.

  • Default values for readonly properties.

  • A SortDirection enum and a new polling API.

None of these are urgent for an existing site. They're good reasons to start new projects on 8.6 once your host supports it.

Laravel: what each version supports

Laravel versionSupported PHP versions
Laravel 128.2 to 8.5
Laravel 138.3 to 8.5, plus 8.6 from v13.44

So a Laravel 12 app can't officially run on PHP 8.6. If you want 8.6, upgrade to Laravel 13 first. Laravel 12's security support ends on 24 February 2027, so planning that upgrade in early 2027 makes sense anyway.

For a Laravel 12 app today, PHP 8.3, 8.4 or 8.5 are all reasonable. Newer gives you a longer support window, and 8.3 is a safe, conservative pick if your packages haven't caught up yet.

WordPress: check plugins, not just core

WordPress core usually supports new PHP releases quickly, but plugins and themes are the real constraint. An abandoned plugin can throw errors on a newer PHP version.

Before upgrading:

  1. Update WordPress core, plugins and themes.

  2. Check each plugin's page for "tested up to" information and recent updates.

  3. Remove plugins that haven't been updated in a long time.

  4. Test on a staging copy if your host offers one.

Shared hosting limits your options

You can only choose versions your host offers. For example, Hostinger's shared plans currently offer PHP 8.2 to 8.5, so PHP 8.6 isn't an option there yet.

On many shared plans, the PHP version setting applies to every website in the plan, not just one. If you host several sites together, make sure all of them are ready before switching.

How to upgrade without downtime

  1. Check compatibility. Confirm your framework, packages and plugins support the target version. For Composer projects, update require.php in composer.json and run composer update --dry-run locally to spot conflicts.

  2. Test locally or on staging. Run your test suite and click through key pages under the new version.

  3. Pick a quiet time. Switching PHP on hosting usually takes effect in seconds, but schedule it when traffic is low.

  4. Switch and watch logs. Change the version in your hosting panel, then check the error log and key pages immediately.

  5. Have a rollback ready. If something breaks, switch back in the panel, which is equally quick, then fix the issue on staging.

The short answer

  • New project: the newest version your host and framework support. 8.5 today, 8.6 once supported.

  • Existing Laravel 12 app: 8.3 to 8.5. Plan Laravel 13 for early 2027.

  • WordPress site: 8.3 or newer, after checking plugins.

  • On 8.2 or older: upgrade before 31 December 2026.

Related reading: PHP security updates: what site owners should do · Dev and production parity: database lessons

Frequently asked questions

Which PHP version is best for Laravel 12?

PHP 8.3, 8.4 or 8.5. Laravel 12 supports 8.2 to 8.5, but 8.2 loses security support at the end of 2026.

When does PHP 8.2 support end?

Security support for PHP 8.2 ends on 31 December 2026.

Can I use PHP 8.6 with Laravel?

Yes, with Laravel 13 from version 13.44. Laravel 12 doesn't officially support PHP 8.6.

Is it safe to switch PHP versions on shared hosting?

Usually, if you've checked compatibility first. The switch is quick and reversible from your hosting panel, but it may apply to every site on the plan.


Sources: PHP supported versions page and PHP 8.6 release announcement (19 November 2026); Laravel support policy and upgrade documentation; Hostinger PHP version documentation. Support dates are as published on 30 November 2026.

Further reading: PHP: supported versions · Laravel: support policy

The stream

All stories