PHP 8.3 Updates | What is new in PHP 8.3

Other Blogs

Blogs ❯❯ PHP

Image could not load

PHP 8.3 Updates

Hello developers! आज हम बात करेंगे PHP के latest version - PHP 8.3 के bare में।

November 23, 2023 को release हुए इस version में बहुत सारे exciting features और improvements add किये गए हैं ,चलिए देखते हैं कि क्या नया है इस version में।

PHP json_validate() Function

JSON data के साथ काम करते time एक common task होता है उसकी validity check करना। PHP 8.3 में new json_validate() function introduce किया गया है।

अब आप बिना JSON को decode किये check कर सकते हैं कि string valid JSON है या नहीं।

$isValid = json_validate($jsonString); if ($isValid) { echo "Valid JSON"; }

Deep Cloning In Readonly Properties

PHP 8.3 में readonly properties को clone करने का better support add किया गया है। अब आप __clone method में readonly properties को reinitialize कर सकते हैं।

class User { public readonly string $id; public function __clone() { $this->id = generateNewId(); } }

Override Attribute

नया #[\Override] attribute add किया गया है, इससे आप clearly indicate कर सकते हैं कि कौनसा method parent class के method को override कर रहा है।

class Child extends Parent { #[\Override] public function getMessage() { return "Hello World"; } }

New Features In Random Extension

Random numbers generate करने के लिए new methods add किये गए हैं -

  1. getBytesFromString()

  2. getFloat()

  3. nextFloat()

$random = new Random\Randomizer(); $float = $random->getFloat(); // 0 se 1 ke beech random float

Performance Improvements

PHP 8.3 में performance के लिए बहुत सारे improvements किये गए हैं -

  • JIT compilation में enhancement

  • Object creation और memory management में optimization

  • Garbage collection में improvements

Conclusion 🎯

PHP 8.3 developer productivity और application performance दोनो को improve करता है। अगर आप PHP developer हैं, तो इन new features का use करके अपने code को more efficient और maintainable बना सकते हैं।

Happy coding ! 🚀

Hey ! I'm Rahul founder of learnhindituts.com. Working in IT industry more than 5.5 years. I love to talk about programming as well as writing technical tutorials and blogs that can help to others .... keep learning :)

Get connected with me - LinkedIn Twitter Instagram Facebook

Your Thought ?

Please wait . . .

    Recent Blogs

    Loading ...

    0 Comment(s) found !