PHP 8: The Five Most long-awaited Updates and What they Mean

The Five Most long-awaited Updates and What they Mean

New Features in PHP 8

1. New Features

2. Reclassified Engine Warnings

3. New PHP Functions

1. Union Types

  • strict enforcement of types, so mistakes are caught early.
  • Type information is less likely to become outdated or miss border-cases.
  • Types are checked during inheritance, enforcing the Liskov Substitution Principle that any method should return the same type as that of its parent.
  • Type information is accessible at runtime through reflection.
  • The syntax is a lot more formal than phpdoc.

2. The Just-In-Time Compiler (JIT Compiler)

  • Lexing/Tokenizing:
  • Parsing:
  • Compilation:
  • Interpretation:

3. Named arguments

4. Match expression

  • The match expression is significantly shorter to code,
  • It can return values
  • It needs no break statements,
  • The match can combine conditions,
  • It does not coerce any type.

5. New mixed type

  • A function returning nothing or null
  • The return value may be one of many types
  • The return value is a type that cannot be suggested in PHP

Conclusion

--

--

--

Raindrops Infotech is a top web development company in the USA, specializing in website design and web development agency. https://www.raindropsinfotech.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

[Solved] How To Fix “data-vocabulary.org schema deprecated” Error in Webmaster

Fix data-vocabulary.org schema deprecated” Error

AWS Direct Connect: VGW & TGW

21 Days of AWS using Terraform — Day 5- AWS Auto-Scaling Group using Terraform

Weekly Development Update

Evolution of the API

Finding lonely nodes in a binary tree

New PowerShell script on GitHub to add WVD Hosts to a host pool

Laravel OTP AUTH

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raindrops Infotech

Raindrops Infotech

Raindrops Infotech is a top web development company in the USA, specializing in website design and web development agency. https://www.raindropsinfotech.com/

More from Medium

The Wrapper Upgrade: Sigma sDIOS (ssDIOS), and Why?

The Secure Edge: Daily Round-up of Infosec Blogs — Issue #59

Doug Ford Bitcoin Prime — Review

Starting as a Project Owner Graduate at Motius — A Recap After the First 3 Months