Plans & Pricing

PHP 8.2 Is Running Out. Is Your Drupal Site Ready for 8.3?

Add us as a preferred source on Google
A teddy bear in reading glasses checks a laptop checklist with a magnifying glass beside an hourglass, next to the headline PHP 8.2 Is Running Out. Is Your Drupal Site Ready for 8.3?

PHP 8.2 security support ends December 31, 2026. php.net says 8.2 "will receive no further security fixes after that date. Please plan your upgrade to a supported version" (php.net).

Before you start, make sure your site has PHP's latest security fixes. My PHP security update post covers the October 2026 release that fixed two remote code execution flaws.

Drupal 10 ends even sooner, on December 9, 2026 (Drupal core release schedule).

PHP's own list of 8.3 breaking changes is short (php.net migration guide), so the move rarely breaks your own code. It breaks the tools around it, and some of those failures report success.

This check takes about 30 minutes on a copy of your site. At the end you'll have a yes or a no, and a list of what to fix.


What you need before you start

  • A copy of your site. Your host may call it staging or a test site. It has to run the same PHP as live.
  • A developer, or SSH access. Steps 3 and 4 are marked (Developer).
  • About 30 minutes. The switch itself comes after the check.
  • A note with five blanks to fill in.
    • The PHP version the website runs
    • The PHP version the command line runs
    • Your Drupal version
    • Your Drush version
    • Any PHP version pinned in composer.json

Step 1. Write down the PHP your site runs, on the website and the command line

Go to /admin/reports/status (Reports > Status report). The PHP version card shows the PHP that serves your website.

The Drupal Status report showing Drupal version 10.6.19 and PHP version 8.3.21 in the General System Information cards.

This test site runs Drupal 10.6.19 on PHP 8.3.21, an older 8.3 release. Keep your site on the latest 8.3 release.

Drush, Composer, and any cron job that runs Drush use the command-line PHP, which can be a different version. Over SSH, run these from your site's folder:

drush status --fields=php-bin,php-version
php -v

On Drupal 7's Drush 8, drush status has no PHP version field. Run this instead:

drush php-eval 'echo PHP_VERSION, PHP_EOL;'

On a multisite, add --uri=<site> to each Drush command, and check every site's status report (Drush usage docs).

If the website and the command line show different versions, write both down. My PHP survival guide shows how to make the command-line PHP match on cPanel.

How you know it worked. Two PHP versions are on your note.


Step 2. Check that your Drupal version runs PHP 8.3

Your DrupalRuns PHP 8.3?What to do first
Drupal 7Only on core 7.103Update core to 7.103
Drupal 10.0 to 10.5No longer gets security fixesUpdate to 10.6, the only Drupal 10 minor that still gets fixes
Drupal 10.6YesNothing
Drupal 11Yes, every release needs 8.3 or laterNothing

Sources: Drupal PHP requirements, Drupal 7 PHP requirements, Drupal 7.103 release notes.

The Drupal 7.103 notes add a warning. It's "the first Drupal 7 release to pass tests in PHP 8.3. However there may still be problems not revealed by Drupal core's test suite, especially on sites with contrib (and custom) modules."

7.103 was the last Drupal 7 release, and Drupal 7 is past its end of life (Drupal 7 changelog). Plan the move off Drupal 7 now.

Drush has its own PHP rules:

Run drush --version to see yours.

How you know it worked. The table says your Drupal version runs 8.3, and your Drush version meets its rule.


Step 3. Ask Composer what blocks PHP 8.3 (Developer)

Composer knows the PHP rules of every module and library your site installed. Ask it:

composer why-not php 8.3.36

Replace 8.3.36 with the latest 8.3 release your host offers.

This is the same check the Upgrade Status report tells you to run before a PHP change (Upgrade Status). Use the exact version your host will install, because composer why-not php 8.3 tests 8.3.0 only.

  • A clean result starts with There is no installed package depending on "php" in versions not matching 8.3.36.
  • A problem lists each package whose rules don't allow 8.3. Update those packages first.
  • If an update doesn't fix a package, look for a patch in its issue queue on drupal.org, or replace the module.

Next, look for a PHP pin. Open composer.json and search for "platform". A pin like this tells Composer to pretend your server runs PHP 8.1:

"config": {
    "platform": {
        "php": "8.1"
    }
}

An old pin blocks newer packages. One r/drupal user hit this error, with PHP 8.3 installed and a pin left at 8.1 (r/drupal):

Your php-64bit version (8.1; overridden via config.platform, actual: 8.3.27)

Set the pin to the PHP that live runs now. You raise it in Step 6, after live moves (Composer config docs).

Your developer can also run composer check-platform-reqs with the copy's PHP 8.3 command line, which also catches missing PHP extensions (Composer command-line docs).

Drupal 7 sites without Composer skip to Step 4.

How you know it worked. Composer lists no blocking package, and any pin matches live.


Step 4. Scan your custom code for PHP 8.3 (Developer)

Composer only checks packages. Your custom modules and themes need a scanner. PHPCompatibility reads the code and flags anything PHP 8.3 changed.

On the copy, from your site's folder:

composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer require --dev phpcompatibility/php-compatibility:"^10.0.0@dev"
vendor/bin/phpcs -p web/modules/custom web/themes/custom --standard=PHPCompatibility --runtime-set testVersion 8.3- --extensions=php,module,inc,install,theme,profile,test --ignore='*/node_modules/*,*/vendor/*'
  • The dash in 8.3- also checks every later PHP version.
  • Keep the --extensions part. Without it, the scan skips .module, .install and .theme files.
  • If your site's folder is docroot/ instead of web/, change the paths to match.
  • Use 10.x as shown. It's a pre-release, but the last stable release came out in 2019, before PHP 8.
  • A clean scan is a good sign, not proof. PHPCompatibility doesn't check every 8.3 change yet, including range() (PHPCompatibility issue 1589).
  • Search your custom code for range( by hand, and check each call against the change below.

On Drupal 7, install the scanner globally and scan sites/all. My PHP survival guide has the Drupal 7 scanner commands.

When you're done, undo the scanner's changes on the copy. If your site is in git, run the commands below. If it isn't, restore your backup copies of composer.json and composer.lock.

git checkout composer.json composer.lock
composer install

What PHP 8.3 actually changed

The list is short, and most of it is rare in Drupal code (php.net, PHP 8.3 incompatible changes):

  • range() throws new errors, and some calls return letters instead of numbers.
  • number_format() with negative decimals now rounds before the decimal point.
  • Date code throws DateError and DateException where it used to warn.
  • Traits with static properties behave differently under inheritance.

PHP 8.3 also deprecated a few things. They still run, but they write notices to your log (php.net, PHP 8.3 deprecations):

  • get_class() and get_parent_class() with no arguments
  • ++ and -- on empty or non-numeric strings
  • assert_options()

If you're coming from PHP 8.1, you meet the 8.2 deprecations at the same time (php.net, PHP 8.2 deprecations):

  • Dynamic properties (values code adds to an object without declaring them first), unless the class allows them
  • utf8_encode() and utf8_decode()
  • "${var}" inside strings

How you know it worked. The scan shows no errors. Write down any warnings to fix later.


Step 5. Switch the copy and read the logs

Switch PHP on the copy in your host's control panel. On a DDEV copy (DDEV is a tool for running Drupal on your own computer), run:

ddev config --php-version 8.3
ddev restart

Check the status report on the copy. It should show the latest 8.3 release.

Then use the site:

  • Load the home page.
  • Submit a form.
  • Log in.
  • Open anything custom, like a checkout or a members area.

(Developer) Run Drush on the copy:

drush status
drush updb
drush cron

Don't trust a clean exit alone. After drush updb, open the status report and check that no database updates are still pending.

Then read Reports > Recent log messages at /admin/reports/dblog, filtered by type php. That page exists only when the Database Logging module is on. If it isn't, check your host's PHP error log.

Hundreds of "Creation of dynamic property" lines can point to one old module. Note which module it is, because the flood hides real errors.

How you know it worked. No new errors show up, and no database updates are pending.


Step 6. Switch live and keep the way back

  1. Write down the current PHP setting on live.
  2. Check that your host still offers that version, so you can switch back.
  3. Switch live to PHP 8.3.
  4. Check the status report and php -v again.
  5. Read the log again the next day.
  6. Once you're sure you won't switch back, raise any Composer pin with composer config platform.php 8.3.0, then run composer update --lock.

The way back. Set the PHP back to the version on your note. Some hosts charge for old versions or remove them, so check first. My PHP survival guide has a host-by-host rundown of old PHP versions.

Keep the Composer pin at the old version until you're sure. After you raise it, a composer update can install packages that need PHP 8.3. Composer's platform check then stops the site on the old PHP (Composer config docs).

How you know it worked. Live shows the latest 8.3 release your host offers, on the website and on the command line.


What broke on real sites, and how it looked

These are errors we've diagnosed on Drupal sites, plus two reported on r/drupal. Each one shows the error, so you know it when you see it.

1. "Drush requires at least PHP 8.3.0"

  • A site's code required Drush 13.7, while the server's command line ran PHP 8.1.
  • The fix is to run Drush with that version's PHP binary. Then move the server to 8.3.
    • On cPanel, run /usr/local/bin/ea-php83 vendor/bin/drush.php status (cPanel ea-php83 package).
    • On Debian or Ubuntu, run /usr/bin/php8.3 vendor/bin/drush.php status.
  • Composer can stop the site with a similar message, Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.3.0". The fix is the same.
  • Don't set DRUSH_NO_MIN_PHP=1 to skip the check. It runs 8.3 code on old PHP.

2. drush updb said done, and nothing changed

  • A Drupal 7 site came to us running Drush 8.3.5 after its server moved to PHP 8.2.
  • drush updb finished without an error, but the update batch died with Call to undefined function each().
  • The database updates stayed pending.
  • The fix is to update to Drush 8.5.0. You can also run updates at /update.php.

3. A ParseError that names "PREPROCESS_INVOKES"

  • The full error reads ParseError: syntax error, unexpected identifier "PREPROCESS_INVOKES".
  • Drupal 11.2 and later use code that only PHP 8.3 can read (Drupal core source).
  • On older command-line PHP, Drush stops with this error instead of a version message (r/drupal).
  • The fix is to make the command line run PHP 8.3 or later.

4. Hundreds of deprecation lines per page

  • An old Drupal 7 contributed module on PHP 8.2 wrote 300 to 400 "Creation of dynamic property" log entries on each admin page.
  • They buried the real errors, and that much logging can push a long batch (a big job Drupal splits into steps) past its time limit.
  • The fix is to update or replace that module.

5. Live moved, and the copy didn't

  • A host or someone else can switch live to 8.3 without touching the copy.
  • Tests on that copy then check the wrong PHP.
  • The fix is to check the copy's PHP version before every test.

Should you stop at 8.3 or go to 8.4?

PHPSecurity fixes endRuns on
8.3December 31, 2027Drupal 7.103, Drupal 10.6, Drupal 11
8.4December 31, 2028Drupal 10.6, Drupal 11
8.5December 31, 2029Drupal 11.3 and later, Drupal 12

Source: PHP supported versions, Drupal PHP requirements.

  • On Drupal 10.6 or 11, aim for 8.4. Drupal 10.6 recommends PHP 8.4 (10.6 core source), and so does Drupal 11 (11.x core source). 8.3 is the floor.
    • Run composer why-not php 8.4.27.
    • Run the PHPCompatibility scan again with --runtime-set testVersion 8.4-.
    • If both pass, go to 8.4. You get one more year of fixes.
  • On Drupal 11.3 or later, PHP 8.5 also works. Drupal 12 is the move that makes 8.5 required (Drupal core source).
  • On Drupal 7, 8.3 is as far as core goes. Plan your next move before the end of 2027.
  • On Drupal 10, you also face December 9. My Drupal 11 readiness check takes another 30 minutes.

Your PHP 8.3 checklist

  1. Write down the website PHP and the command-line PHP.
  2. Confirm your Drupal version runs 8.3.
  3. Confirm your Drush version meets its rule.
  4. Run composer why-not php with the latest 8.3 release.
  5. Check composer.json for a PHP pin.
  6. Scan custom code with PHPCompatibility.
  7. Switch the copy to 8.3.
  8. Use the site and run Drush on the copy.
  9. Read the PHP log on the copy.
  10. Write down the live PHP setting.
  11. Switch live to 8.3.
  12. Check both PHP versions on live.
  13. Read the log the next day.
  14. Raise the Composer pin once you're sure.

A copy to print:

PHP 8.3 CHECK
[ ] Website PHP: ______   Command-line PHP: ______
[ ] Drupal version runs 8.3: ______
[ ] Drush version meets its rule: ______
[ ] composer why-not php 8.3.__ is clean
[ ] composer.json PHP pin: ______
[ ] PHPCompatibility scan shows no errors
[ ] Copy switched to the latest 8.3
[ ] Home page, form, login and custom pages work on the copy
[ ] drush updb leaves no pending updates
[ ] PHP log on the copy shows no new errors
[ ] Live PHP setting written down: ______
[ ] Live switched, both PHP versions checked
[ ] Log read the next day
[ ] Composer pin raised

Want someone else to handle this?

Not everyone has time to read scan reports and test PHP versions. Drupal version upgrades and Drupal support are what we do at Drupal Aid.

  • We back up your entire site before we start.
  • We test the new PHP version on a copy of your site before live changes.

We also work as a white-label partner for agencies, handling PHP upgrades for your clients' sites under your name.


Sources


About the Author

Bob Kruse is the founder of Drupal Aid and a Drupal fanatic since 2008. Drupal Aid has provided Drupal maintenance and security support since 2014. Read more about Drupal Aid or contact us.


Get our best Drupal advice first

Each week we send 1 email to smart Drupal website owners.

We will not share your email. Privacy policy

Comments

Have a question about this update? Ask it here.

Keep reading

See all posts →