avatarCaleb

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2579

Abstract

without requiring parameters.</li></ul><figure id="a894"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*vOkL9r-gjFU-9xft0z5meA.png"><figcaption></figcaption></figure><h1 id="256e">The #[\Override] Attribute: Safeguarding Method Overrides</h1><p id="1593">The <code>#[\Override]</code> attribute is a new safety net, ensuring that a method indeed overrides a parent class method.</p><p id="d060">PHP will now throw an error if the method does not exist in the parent class, reducing the risk of unintended behaviors in code evolution.</p><p id="9d2e">For example:</p><figure id="b523"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*NVOFQt_yOFB9pMtlpqPmSA.png"><figcaption></figcaption></figure><h1 id="4d35">More Improvements and Deprecated Elements</h1><p id="bb15">Other notable changes in PHP 8.3 include:</p><ul><li>Resetting readonly properties during object cloning.</li><li>More detailed error messages for Date and Time class exceptions.</li><li>Enhanced error handling for <code>unserialize()</code>.</li><li>Deprecation of INI parameters <code>assert.active</code>, <code>assert.bail</code>, <code>assert.callback</code>, <code>assert.exception</code>, and <code>assert.warning</code>.</li><li>Deprecated use of <code>get_class()</code> and <code>get_parent_class()</code> without arguments.</li></ul><p id="a554">For a deeper dive into PHP 8.3, its official release page offers extensive insights and details.</p><div id="0100" class="link-block"> <a href="https://www.php.net/releases/8.3/en.php"> <div> <div> <h2>PHP 8.3 Released</h2> <div><h3>PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class…</h3></div> <div><p>www.php.net</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*UbAoRM95hGyW4-p_)"></div> </div> </div> </a> </div><h2 id="2dd0">Conclusion</h2><p id="b5bc">PHP 8.3, while not introducing groundbreaking changes, reinforces the language’s commitment to evolving in a way that meets the needs of modern development.</p><p id="8212">This update streamlines functionality, enhances clarity, and introduces safeguards that collectively shape a more robust and efficient PHP.</p><p id="5003">As developers, it’s an exciting time to witness and adapt to these continual improvements, ensuring our skills and applications remain cutting-

Options

edge.</p><div id="abd1" class="link-block"> <a href="https://medium.com/@calebpr/subscribe"> <div> <div> <h2>Get an email whenever Caleb publishes.</h2> <div><h3>Get an email whenever Caleb publishes. By signing up, you will create a Medium account if you don’t already have one…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*pPSGj3ORvqLvuBYg)"></div> </div> </div> </a> </div><p id="91bd"><i>Enjoyed the read? For more on Web Development, JavaScript, Next.js, Cybersecurity, and Blockchain, check out my other articles here:</i></p><div id="7e3a" class="link-block"> <a href="https://readmedium.com/a-roadmap-to-my-medium-writings-fd04e14cffd7"> <div> <div> <h2>A Roadmap to My Medium Writings</h2> <div><h3>undefined</h3></div> <div><p>undefined</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*FO4S90VIpPA05s9cP-gFPQ.png)"></div> </div> </div> </a> </div><p id="8496"><i>If you have questions or feedback, don’t hesitate to reach out at [email protected] or in the comments section.</i></p><p id="c73a"><i>[Disclosure: Every article I pen is a fusion of my ideas and the supportive capabilities of artificial intelligence. While AI assists in refining and elaborating, the core thoughts and concepts stem from my perspective and knowledge. <a href="https://readmedium.com/how-does-ai-help-me-write-my-articles-5df265d16527">To know more about my creative process, read this article.</a>]</i></p><div id="a005" class="link-block"> <a href="https://readmedium.com/how-does-ai-help-me-write-my-articles-5df265d16527"> <div> <div> <h2>How Does AI Help Me Write My Articles?</h2> <div><h3>The Medium landscape has seen a transformation, with an increasing number of articles appearing to have the distinct…</h3></div> <div><p>medium.commm</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*sURudlO3SS5ntthELFumcg.jpeg)"></div> </div> </div> </a> </div></article></body>

What’s New in PHP 8.3?

PHP 8.3 has officially landed today, marking a significant step in the language’s ongoing evolution.

As we delve into this latest update, we uncover a mix of refinements, new features, and important deprecations that collectively aim to streamline PHP’s capabilities and align them more closely with modern programming paradigms.

Spring Cleaning in PHP 8.3: A Focus on Refinement

Unlike the substantial overhauls seen in PHP 8.1 and 8.2, PHP 8.3 leans towards ‘housekeeping’, ensuring the language stays clean, efficient, and coherent with its recent trajectory.

Introducing json_validate: A Leap in JSON Handling

A notable addition is the json_validate function.

Preceded by json_decode, this new function offers a more resource-efficient way to validate JSON strings, enhancing performance and simplifying implementations.

Typed Constants and Dynamic Access: A Stride Towards Clarity

PHP 8.3 brings a game-changing feature: the ability to type constants.

This enhancement, along with the newfound capability to access constants dynamically, will undoubtedly elevate the clarity and robustness of PHP code.

Randomizer Class Enhancements: Refined Randomness

Building on the Randomizer class introduced in PHP 8.2, PHP 8.3 adds three new methods:

  • getBytesFromString(): Randomly selects a specified number of characters from a string.
  • getFloat(): Generates a random float within a given range.
  • nextFloat(): Similar to getFloat, but always returns a float between 0 and 1, without requiring parameters.

The #[\Override] Attribute: Safeguarding Method Overrides

The #[\Override] attribute is a new safety net, ensuring that a method indeed overrides a parent class method.

PHP will now throw an error if the method does not exist in the parent class, reducing the risk of unintended behaviors in code evolution.

For example:

More Improvements and Deprecated Elements

Other notable changes in PHP 8.3 include:

  • Resetting readonly properties during object cloning.
  • More detailed error messages for Date and Time class exceptions.
  • Enhanced error handling for unserialize().
  • Deprecation of INI parameters assert.active, assert.bail, assert.callback, assert.exception, and assert.warning.
  • Deprecated use of get_class() and get_parent_class() without arguments.

For a deeper dive into PHP 8.3, its official release page offers extensive insights and details.

Conclusion

PHP 8.3, while not introducing groundbreaking changes, reinforces the language’s commitment to evolving in a way that meets the needs of modern development.

This update streamlines functionality, enhances clarity, and introduces safeguards that collectively shape a more robust and efficient PHP.

As developers, it’s an exciting time to witness and adapt to these continual improvements, ensuring our skills and applications remain cutting-edge.

Enjoyed the read? For more on Web Development, JavaScript, Next.js, Cybersecurity, and Blockchain, check out my other articles here:

If you have questions or feedback, don’t hesitate to reach out at [email protected] or in the comments section.

[Disclosure: Every article I pen is a fusion of my ideas and the supportive capabilities of artificial intelligence. While AI assists in refining and elaborating, the core thoughts and concepts stem from my perspective and knowledge. To know more about my creative process, read this article.]

PHP
Programming
Software Development
Web Development
Startup
Recommended from ReadMedium