Skip to content

Small presentation on the new feature and changes in PHP 8 in comparison to 7.4

License

Notifications You must be signed in to change notification settings

SykesCottages/php8.0-demo

Repository files navigation

Demonstration

New Key Features

  • Named arguments RFC
  • Attributes RFC
  • Constructor property promotion RFC
  • Union types RFC
  • Match expression RFC
  • Nullsafe operator RFC
  • Saner string to number comparisons RFC
  • Consistent type errors for internal functions RFC

Other Notes

Type system and error handling improvements

  • Stricter type checks for arithmetic/bitwise operators RFC
  • Abstract trait method validation RFC
  • Correct signatures of magic methods RFC
  • Reclassified engine warnings RFC
  • Fatal error for incompatible method signatures RFC
  • The @ operator no longer silences fatal errors.
  • Inheritance with private methods RFC
  • Mixed type RFC
  • Static return type RFC
  • Types for internal functions Email thread
  • Opaque objects instead of resources for Curl, Gd, Sockets, OpenSSL, XMLWriter, and XML extensions

Other syntax tweaks and improvements

  • Allow a trailing comma in parameter lists RFC and closure use lists RFC
  • Non-capturing catches RFC
  • Variable Syntax Tweaks RFC
  • Treat namespaced names as single token RFC
  • Throw is now an expression RFC
  • Allow ::class on objects RFC

New Classes, Interfaces, and Functions

  • Weak Map class
  • Stringable interface
  • str_contains(), str_starts_with(), str_ends_with()
  • fdiv()
  • get_debug_type()
  • get_resource_id()
  • token_get_all() object implementation

Sources:

About

Small presentation on the new feature and changes in PHP 8 in comparison to 7.4

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published