<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Divyaraj Rathore</title>
    <description>The latest articles on DEV Community by Divyaraj Rathore (@divyaraj_rathore_58580d7e).</description>
    <link>https://dev.to/divyaraj_rathore_58580d7e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4268599%2Ff4b2d73a-615d-4bcb-9078-3fd54ba6b626.jpeg</url>
      <title>DEV Community: Divyaraj Rathore</title>
      <link>https://dev.to/divyaraj_rathore_58580d7e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/divyaraj_rathore_58580d7e"/>
    <language>en</language>
    <item>
      <title>PHP 8.2 loses security support on 31 December 2026: a practical upgrade plan</title>
      <dc:creator>Divyaraj Rathore</dc:creator>
      <pubDate>Fri, 27 Nov 2026 10:06:02 +0000</pubDate>
      <link>https://dev.to/divyaraj_rathore_58580d7e/php-82-loses-security-support-on-31-december-2026-a-practical-upgrade-plan-38mf</link>
      <guid>https://dev.to/divyaraj_rathore_58580d7e/php-82-loses-security-support-on-31-december-2026-a-practical-upgrade-plan-38mf</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0owqfiw2n8yxm6ta8530.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0owqfiw2n8yxm6ta8530.jpeg" alt=" " width="800" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Disclosure: I run Looking For Developer, where our team does PHP upgrades for clients. This is the checklist we follow.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;PHP 8.2 receives security fixes only until 31 December 2026, and PHP 8.1 and older receive none at all. If an application you look after still runs on 8.2 or older, this is the plan we use to upgrade without surprises.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find out what you are really running
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;php -v&lt;/code&gt; on the server, but also check the version the website itself uses (a &lt;code&gt;phpinfo()&lt;/code&gt; page or the hosting panel). The command line and the web server can run different versions.&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;require.php&lt;/code&gt; and &lt;code&gt;config.platform.php&lt;/code&gt; in &lt;code&gt;composer.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Note the framework version, for example with &lt;code&gt;composer show laravel/framework&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Ask Composer what blocks the new version
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer why-not php 8.4
composer outdated --direct
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;why-not&lt;/code&gt; lists the packages whose requirements exclude PHP 8.4. Update or replace those first; everything else is easier once the dependencies allow the new version.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Let tools find the code changes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Rector can apply most version upgrades automatically. Add &lt;code&gt;-&amp;gt;withPhpSets(php84: true)&lt;/code&gt; to &lt;code&gt;rector.php&lt;/code&gt;, then run &lt;code&gt;vendor/bin/rector process --dry-run&lt;/code&gt; and review the diff before applying it.&lt;/li&gt;
&lt;li&gt;PHPStan checks the code against the target version. Set &lt;code&gt;phpVersion: 80400&lt;/code&gt; under parameters in &lt;code&gt;phpstan.neon&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Fix the usual suspects
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic properties (setting a property that the class does not declare) are deprecated since PHP 8.2. Declare the property, or add &lt;code&gt;#[\AllowDynamicProperties]&lt;/code&gt; as a temporary fix.&lt;/li&gt;
&lt;li&gt;Implicitly nullable parameters such as &lt;code&gt;function save(Model $model = null)&lt;/code&gt; are deprecated in PHP 8.4. Write &lt;code&gt;?Model $model = null&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;Passing null to built-in functions that expect a string, such as &lt;code&gt;strlen(null)&lt;/code&gt;, is deprecated since PHP 8.1.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"${var}"&lt;/code&gt; string interpolation is deprecated since PHP 8.2. Use &lt;code&gt;"{$var}"&lt;/code&gt; instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Test on staging with the new version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Run the test suite on both the old and the new version, for example as a CI matrix.&lt;/li&gt;
&lt;li&gt;No tests? List the flows that must never break, such as login, checkout, the contact form and saving in the admin. Click through them, and add simple automated tests for the top three.&lt;/li&gt;
&lt;li&gt;Turn on full error reporting on staging, so deprecation notices appear in the logs instead of disappearing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Switch production carefully
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Shared hosting (cPanel): switch the domain's version in MultiPHP Manager, test, and switch back straight away if something breaks.&lt;/li&gt;
&lt;li&gt;VPS: install the new PHP-FPM version next to the old one and point the site at it. Keep the old one for a quick rollback.&lt;/li&gt;
&lt;li&gt;Don't forget the command line. Cron jobs and queue workers often keep using the old version. Update them, and restart the queue workers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which version should you move to?
&lt;/h2&gt;

&lt;p&gt;The newest one that your framework and packages support, because it gives you the longest support. According to php.net, PHP 8.3 gets security fixes until 31 December 2027 and PHP 8.4 until 31 December 2028.&lt;/p&gt;

&lt;p&gt;If you would rather hand the upgrade off, our team does staged PHP upgrades with a fixed price per step: PHP developers at Looking For Developer.&lt;/p&gt;

&lt;p&gt;If you are planning a PHP upgrade and want to estimate your development budget, you can use our free &lt;a href="https://lookingfordeveloper.com/tools/developer-cost-calculator" rel="noopener noreferrer"&gt;Developer cost calculator&lt;/a&gt; to calculate the estimated cost based on your required development hours.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>webdev</category>
      <category>security</category>
    </item>
  </channel>
</rss>
