Skip to main content

PHP 8.1

PHP 8.1 introduced enums, readonly properties, fibers, pure intersection types and the never return type. php-ci provides a maintained 8.1 image so projects on the oldest still-relevant release can keep their pipelines green.

Image tag

docker pull himanshuramavat/php-ci:8.1
PropertyValue
Image taghimanshuramavat/php-ci:8.1
PHP branch8.1.x
StatusSecurity fixes only
End of active support

PHP 8.1 reached the end of its active support window and now receives security fixes only (upstream security support ends 31 Dec 2025). Plan a migration to PHP 8.2 or newer.

When to use it

  • You maintain a legacy application or library that has not yet been validated on 8.2+.
  • You publish a package and want to prove backward compatibility across the full supported range in a test matrix.

Run the suite

docker run --rm -v "$(pwd):/app" -w /app himanshuramavat/php-ci:8.1 \
bash -c "composer install --no-interaction && ./vendor/bin/phpunit"

Language features available

  • Enumerations (enum Status { case Active; })
  • readonly properties
  • Fibers (the foundation for async runtimes)
  • First-class callable syntax ($fn = strlen(...);)
  • Pure intersection types (A&B)
  • never return type

Notes

  • Use this tag in a compatibility matrix alongside newer versions — see the GitHub Actions matrix example.
  • For deprecation-free output on this branch, run PHPUnit with --display-deprecations to surface code that will break on later versions.