PHP 8.3: Release Date and New Features

Websolutionstuff | Jan-12-2023 | Categories : PHP

Welcome web development enthusiasts! Here, we are going to talk about the much-awaited PHP 8.3.

It is packed with a myriad of enhancements and new features, so developers are buzzing with excitement.

It is scheduled to launch with interesting updates, and it will redefine the programming world. Join us on an exploration of the release date, key features, and the impact PHP 8.3 is set to make in the dynamic web development world.

Now, we will see PHP 8.3 release date, and PHP 8.3 new features.

For instance, this page lists all the accepted RFCs for PHP 8.3.

 

PHP 8.3 New Features and Release Date

 

Table of contents

  • When will PHP 8.3 be released?
  • PHP 8.3 changes and new features
    • json_validate()
    • Improved unserialize() error handling

 

When will PHP 8.3 be released?

As per the PHP 8.3 preparation chartPHP 8.3 will be released on November 23, 2023.

Date Release
Jun 08 2023 Alpha 1
Jun 22 2023 Alpha 2
Jul 06 2023 Alpha 3
Jul 18 2023 Feature freeze
Jul 20 2023 Beta 1
Aug 03 2023 Beta 2
Aug 17 2023 Beta 3
Aug 31 2023 RC 1
Sep 14 2023 RC 2
Sep 28 2023 RC 3
Oct 12 2023 RC 4
Oct 26 2023 RC 5
Nov 09 2023 RC 6
Nov 23 2023 GA

 

PHP 8.3 changes and new features

json_validate()

This RFC introduces a new function called json_validate() to validate if a string contains a valid JSON.

Instead of using json_decode() function to validate a JSON string. Now, you can use json_validate(). According to its RFC. 

Returns true if the string passed contains a valid JSON, otherwise returns false.

json_validate('{ "foo": "bar", }');
 
// Syntax error
echo json_last_error_msg();

 

Read More: PHP RFC: json_validate

 

Improved unserialize() error handling

PHP's current error reporting in unserialize() is very inconsistent, making it hard to reliably handle errors that occur during unserialization. In PHP 8.3 new \UnserializationFailedException will be added. Also, improve error handling.

Let's see an example:

try {
    set_error_handler(static function ($severity, $message, $file, $line) {
        throw new \ErrorException($message, 0, $severity, $file, $line);
    });
    $result = unserialize($serialized);
} catch (\Throwable $e) {
    // Unserialization failed. Catch block optional if the error should not be handled.
} finally {
    restore_error_handler();
}

In PHP 8.3, the error are handled is like the below code example.

try {
    $result = unserialize($serialized);
    var_dump($result); // Do something with the $result. Can appear in the 'try' right
                       // beside the unserialize(), because the 'catch' block is specific
                       // to unserialization and will not catch anything unrelated.
} catch (\UnserializationFailureException $e) {
    // unserialization failed.
}

 

Read More: PHP RFC: Improve unserialize() error handling

Conclusion

PHP enthusiasts have much to look forward to with the upcoming release of PHP 8.3. With an expected release date that promises to step into a new era of web development, this update is set to redefine the way we code.

The new features, including improved type safety, new functions, and enhancements to performance and developer experience, are a testament to the language's commitment to progress and innovation.

PHP 8.3 is going to make your programming experience more efficient and enjoyable.
 


You might also like:

Recommended Post
Featured Post
How To Install PHP CURL Extension In Ubuntu
How To Install PHP CURL Extens...

In this article, we will focus on the installation process of the PHP cURL extension in Ubuntu 22.04. The PHP cURL exten...

Read More

Jul-21-2023

How To Install Vue 3 In Laravel 9 With Vite
How To Install Vue 3 In Larave...

In this article, we will see how to install Vue 3 in laravel 9 with vite. In the previous article, we will install...

Read More

Oct-10-2022

How to Handle Exception in PHP with Example
How to Handle Exception in PHP...

Hey there, Ever found yourself scratching your head over unexpected errors in your PHP code? Fret not, because today, we...

Read More

Dec-15-2023

How To Disable Specific Dates In jQuery Datepicker
How To Disable Specific Dates...

In this tutorial, we will see how to disable specific dates in jquery datepicker. The jQuery UI Datepicker is...

Read More

Jun-16-2022