Move all files to sculpin/
This commit is contained in:
parent
c5d71803a5
commit
0f61b4e9ee
1514 changed files with 0 additions and 0 deletions
28
sculpin/source/_posts/2025-07-15.md
Normal file
28
sculpin/source/_posts/2025-07-15.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
date: 2025-07-15
|
||||
title: PHP compatibility checking with phpcs
|
||||
permalink: /daily/2025/07/15/php-compatibility-checking-phpcs
|
||||
---
|
||||
|
||||
PHP 8.5 will be the next version of PHP, scheduled for release this November.
|
||||
|
||||
There are new features being added, including the `|>` pipe operator, that I'll look forward to using.
|
||||
|
||||
Once it's released, how can you tell if your application code is compatible?
|
||||
|
||||
Or, if you're stuck on an older version of PHP, how do you know if you can upgrade?
|
||||
|
||||
Running your automated tests is a great first step.
|
||||
|
||||
Another check is to use PHP CodeSniffer, aka (`phpcs`).
|
||||
|
||||
As well as coding standards, it can also run PHP compatibility checks.
|
||||
|
||||
With the [PHP Compatibility Coding Standard][0] installed, running `phpcs -p . --standard=PHPCompatibility` will perform the compatibility check and show any errors.
|
||||
|
||||
To specify a version of PHP to test against, add `--runtime-set testVersion 8.5` using the desired version.
|
||||
|
||||
If you need to make changes, I recommend [using Rector][1] and have it make the changes automatically.
|
||||
|
||||
[0]: https://github.com/PHPCompatibility/PHPCompatibility
|
||||
[1]: /daily/2025/01/31/rector
|
Loading…
Add table
Add a link
Reference in a new issue