SlideShare a Scribd company logo
PHP Versions Upgradation -
What's New vs Old Version
PHP's frequent upgrades to patch issues and provide new
features are its biggest advantages. PHP 8.2 is coming. It may
convince everyone to switch to PHP 8. Let's discuss PHP 8.2's
benefits for developers. First, let's review PHP's history.
8.0
Released in November 2020,
PHP 8.0 brought us the best
features yet, which includes:
Union types Match expression Nullsafe operator
Attributes Constructor property promotion
Named arguments
htmlspecialchars
($string,double_encode:
false);
class Number {
public function
__construct(
private int|float
$number
) {}
}
new Number('NaN'); //
TypeError
echo match (8.0) {
'8.0' => "Oh no!",
8.0 => "This is what I
expected",
};
//> This is what I
expected
$country = $session?-
>user?->getAddress()?-
>country;
class PostsController
{
#[Route("/api/posts/{id}",
methods: ["GET"])]
public function get($id) { /* ...
*/ }
}
class Point {
public function __construct(
public float $x = 0.0,
public float $y = 0.0,
public float $z = 0.0,
) {}
}
8.1
Released in November 2021,
PHP 8.1 brought us the best
features yet, which includes:
New in initializers Pure Intersection Types Fibers
Enumerations Readonly Properties
First-class Callable Syntax
$foo = $this->foo(...);
$fn = strlen(...);
class Service
{
private Logger $logger;
public function
__construct(
Logger $logger =
new NullLogger(),
) {
$this->logger =
$logger;
}
}
function
count_and_iterate(Iterator
&Countable $value) {
foreach ($value as
$val) {
echo $val;
}
count($value);
}
$response = $httpClient-
>request('https://example.
com/');
print
json_decode($response-
>getBody()->buffer())
['code'];
enum Status
{
case Draft;
case Published;
case Archived;
}
function acceptStatus(Status
$status) {...}
class BlogData
{
public readonly Status $status;
public function __construct
(Status$status)
{
$this->status = $status;
}
}
8.2
Released in December 2022,
PHP 8.2 brought us the best
features yet, which includes:
Readonly Classes
Redacting The Support For
Sensitive Parameter Values
True, False, and Null as
Standalone Types
Disjunctive Normal Form Types
Constants in Traits
trait Foo
{
public const CONSTANT = 1;
}
class Bar
{
use Foo;
}
var_dump(Bar::CONSTANT); // 1
var_dump(Foo::CONSTANT); // Error
readonly class MyClass
{
public string $myValue,
public int $myOtherValue
public string $myAnotherValue
public int $myYetAnotherValue
}
function passwords(
$publicpassword,
#[SensitiveParameter]
$secretpassword
) {
throw new Exception('Error');
}
passwords('publicpassword',
'secretpassword');
function alwaysFalse(): false
{
return false;
}
// Accepts an object that implements both A and
B,
// OR an object that implements D.
(A&B)|D
// Accepts an object that implements C,
// OR a child of X that also implements D,
// OR null.
C|(X&D)|null
// Accepts an object that implements all three
of A, B, and D,
// OR an int,
// OR null.
(A&B&D)|int|null
How To Upgrade PHP Version
Check Your Current Version
01
Contact Web Host Provider
02
Create a Site Backup
03
Update WordPress
04
Switch your PHP Version
05
Check For Errors
06
Updates Themes and Plugins
07
Go Live With the Update
08
PHP is improving in syntax simplification
and support for new features with each
new version.
For More Detailed Features of PHP 8.2
You can read the Full blog on
Whats New In PHP 8.2

More Related Content

PPTX
PHP7 Presentation
PDF
PHP7 is coming
PDF
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
PDF
PHP 8: Process & Fixing Insanity
PDF
What is new in PHP
PPTX
PPT
Php Chapter 1 Training
PDF
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
PHP7 Presentation
PHP7 is coming
SummaryHW6 Account ManagementIn HW4, you kept track of multiple.pdf
PHP 8: Process & Fixing Insanity
What is new in PHP
Php Chapter 1 Training
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP

Similar to PHP Versions Upgradation - What's New vs Old Version.pdf (20)

PDF
Giới thiệu PHP 7
PPTX
object oriented programming in PHP & Functions
PPT
Go OO! - Real-life Design Patterns in PHP 5
PDF
Dependency Injection and Pimple
PDF
The state of DI - DPC12
PPT
Managed Compiler
PDF
Dependency Injection
PDF
Living With Legacy Code
PDF
Hack tutorial
PDF
Typed Properties and more: What's coming in PHP 7.4?
PDF
php AND MYSQL _ppt.pdf
PDF
Php Tutorials for Beginners
PPTX
PHPneweeeeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
PDF
Drupal 7 module development
PPTX
PPTX
Introducing PHP Latest Updates
PDF
Phactory
PDF
OOP in PHP
KEY
Intermediate PHP
PDF
Entities in drupal 7
Giới thiệu PHP 7
object oriented programming in PHP & Functions
Go OO! - Real-life Design Patterns in PHP 5
Dependency Injection and Pimple
The state of DI - DPC12
Managed Compiler
Dependency Injection
Living With Legacy Code
Hack tutorial
Typed Properties and more: What's coming in PHP 7.4?
php AND MYSQL _ppt.pdf
Php Tutorials for Beginners
PHPneweeeeeeeeeeeeeeeeeeeeeeeeeeeeee.pptx
Drupal 7 module development
Introducing PHP Latest Updates
Phactory
OOP in PHP
Intermediate PHP
Entities in drupal 7
Ad

More from WPWeb Infotech (20)

PDF
White Label WordPress Development Services.pdf
PDF
Common WordPress errors.pdf
PDF
Outsourcing to India Advantage & Best practices.pdf
PDF
Front End Development Best Practices.pdf
PDF
Why Upgrade Your WordPress System to PHP 8 PDF.pdf
PDF
Technologies PHP Developers Use PDF.pdf
PDF
Unlock-the-Advantages-of-Outsourcing-Web-Development PDF.pdf
PDF
What’s New in WordPress 6.3.pdf
PDF
Why-Your-WordPress-Website-Needs-an-XML-Sitemap PDF.pdf
PDF
How to Set Up WordPress 301 Redirect PDF.pdf
PDF
Exploring-the-Advantages-and-Disadvantages-of-PHP PDF.pdf
PDF
Traditional Outsourcing vs White Label Partnership: Navigating the Future
PDF
Growing-with-White-Label-Web-Development PDF.pdf
PDF
White Label Agency Vs In-house Team PDF.pdf
PDF
Services Offered by White Label Web Development Company -1.pdf
PDF
How-to-Outsource-PHP-Development
PDF
What-are-Comments-in-WordPress
PDF
Best Practices for WordPress Themes PDF.pdf
PDF
How to Create Multivendor Marketplace with WordPress - Pin.pdf
PDF
Troubleshooting Common LAMP Errors
White Label WordPress Development Services.pdf
Common WordPress errors.pdf
Outsourcing to India Advantage & Best practices.pdf
Front End Development Best Practices.pdf
Why Upgrade Your WordPress System to PHP 8 PDF.pdf
Technologies PHP Developers Use PDF.pdf
Unlock-the-Advantages-of-Outsourcing-Web-Development PDF.pdf
What’s New in WordPress 6.3.pdf
Why-Your-WordPress-Website-Needs-an-XML-Sitemap PDF.pdf
How to Set Up WordPress 301 Redirect PDF.pdf
Exploring-the-Advantages-and-Disadvantages-of-PHP PDF.pdf
Traditional Outsourcing vs White Label Partnership: Navigating the Future
Growing-with-White-Label-Web-Development PDF.pdf
White Label Agency Vs In-house Team PDF.pdf
Services Offered by White Label Web Development Company -1.pdf
How-to-Outsource-PHP-Development
What-are-Comments-in-WordPress
Best Practices for WordPress Themes PDF.pdf
How to Create Multivendor Marketplace with WordPress - Pin.pdf
Troubleshooting Common LAMP Errors
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools

PHP Versions Upgradation - What's New vs Old Version.pdf

  • 1. PHP Versions Upgradation - What's New vs Old Version PHP's frequent upgrades to patch issues and provide new features are its biggest advantages. PHP 8.2 is coming. It may convince everyone to switch to PHP 8. Let's discuss PHP 8.2's benefits for developers. First, let's review PHP's history.
  • 2. 8.0 Released in November 2020, PHP 8.0 brought us the best features yet, which includes: Union types Match expression Nullsafe operator Attributes Constructor property promotion Named arguments htmlspecialchars ($string,double_encode: false); class Number { public function __construct( private int|float $number ) {} } new Number('NaN'); // TypeError echo match (8.0) { '8.0' => "Oh no!", 8.0 => "This is what I expected", }; //> This is what I expected $country = $session?- >user?->getAddress()?- >country; class PostsController { #[Route("/api/posts/{id}", methods: ["GET"])] public function get($id) { /* ... */ } } class Point { public function __construct( public float $x = 0.0, public float $y = 0.0, public float $z = 0.0, ) {} }
  • 3. 8.1 Released in November 2021, PHP 8.1 brought us the best features yet, which includes: New in initializers Pure Intersection Types Fibers Enumerations Readonly Properties First-class Callable Syntax $foo = $this->foo(...); $fn = strlen(...); class Service { private Logger $logger; public function __construct( Logger $logger = new NullLogger(), ) { $this->logger = $logger; } } function count_and_iterate(Iterator &Countable $value) { foreach ($value as $val) { echo $val; } count($value); } $response = $httpClient- >request('https://example. com/'); print json_decode($response- >getBody()->buffer()) ['code']; enum Status { case Draft; case Published; case Archived; } function acceptStatus(Status $status) {...} class BlogData { public readonly Status $status; public function __construct (Status$status) { $this->status = $status; } }
  • 4. 8.2 Released in December 2022, PHP 8.2 brought us the best features yet, which includes: Readonly Classes Redacting The Support For Sensitive Parameter Values True, False, and Null as Standalone Types Disjunctive Normal Form Types Constants in Traits trait Foo { public const CONSTANT = 1; } class Bar { use Foo; } var_dump(Bar::CONSTANT); // 1 var_dump(Foo::CONSTANT); // Error readonly class MyClass { public string $myValue, public int $myOtherValue public string $myAnotherValue public int $myYetAnotherValue } function passwords( $publicpassword, #[SensitiveParameter] $secretpassword ) { throw new Exception('Error'); } passwords('publicpassword', 'secretpassword'); function alwaysFalse(): false { return false; } // Accepts an object that implements both A and B, // OR an object that implements D. (A&B)|D // Accepts an object that implements C, // OR a child of X that also implements D, // OR null. C|(X&D)|null // Accepts an object that implements all three of A, B, and D, // OR an int, // OR null. (A&B&D)|int|null
  • 5. How To Upgrade PHP Version Check Your Current Version 01 Contact Web Host Provider 02 Create a Site Backup 03 Update WordPress 04 Switch your PHP Version 05 Check For Errors 06 Updates Themes and Plugins 07 Go Live With the Update 08
  • 6. PHP is improving in syntax simplification and support for new features with each new version. For More Detailed Features of PHP 8.2 You can read the Full blog on Whats New In PHP 8.2