Get Your Code PHP 7 Ready With PhpStorm 10
The release of PHP 7 is fast approaching, and there are some breaking changes that will need to be fixed to make sure your codebase is ready. Thankfully, PhpStorm 10 comes with a great inspection you can run to help you be prepared.
The PHP 7 Compatibility Inspection can show you exactly what code is going to cause errors if you are running PHP 7. It is enabled by default in PhpStorm 10.
Here, you can see that the inspection has marked the class name Int because in PHP 7, int, string, float and bool have all become reserved words. This is useful when you’re working on a single file, but it’s inconceivable that you’ll open every file in your codebase to check there are no red squiggles.
Checking your whole codebase is actually easy, because you can manually run inspections against the scope of your choice. Simply select the Run Inspection By Name… option from the Code menu, and then select the PHP 7 Compatibility inspection. You’ll get asked which scope you’d like to run it on, and then see the results from the inspection in the results pane.
Here, you can see that there are a number of validator classes that get bundled with Zend Framework 2 and have names of words that will be reserved in PHP 7. Now we know exactly what we need to fix so we can be prepared when PHP 7 gets released at the end of November.
Develop with pleasure!
– JetBrains PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
Qodana Clone Finder: Early Access Program
In December 2020, we announced the EAP for Qodana, which is rapidly evolving into a comprehensive platform that allows companies to perform multi-level evaluations of the quality of code they own, contract, or purchase. Qodana helps you detect bugs without relying on an IDE, either on a local machi…
PhpStorm 2020.2 EAP #3
The Early Access Program for PhpStorm 2020.2 is in full swing and today we’ve got the third build of the 2020.2 EAP for you. In this blog post, you can read about improvements for Git installed in WSL2 and Search Everywhere. Download PhpStorm 2020.2 EAP (more…)…
PhpStorm 2019.3.3 Preview
We’ve just rolled out a preview for the third minor update for PhpStorm 2019.3. Please give the PhpStorm 2019.3.3 Preview build 193.6494.5 a try and share your feedback with us. (more…)…
How to Upgrade to PHP 7.4 with PhpStorm
Check out our fresh video with a few nice tips and tricks on how to update your codebase to PHP 7.4. It combines materials from the PhpStorm 2019.2 and PhpStorm 2019.3 releases, with a few cool bonuses to boot. Nikita drew our attention to the fact that setters are slower than assigning prop…