News

PHP 7.4 releases with type declarations, shorthand syntax in Arrow functions, and more!

2 min read

Yesterday, the PHP development team announced the availability of PHP version 7.4. This marks the fourth feature update to the PHP 7 series. PHP 7.4 comes with numerous improvements and new features.

Key features in PHP 7.4

  • Class properties support type declarations.
  • Starting from PHP 7.4, arrow functions will provide a shorthand syntax for defining functions with implicit by-value scope binding
  • The full variance support is only available if autoloading is used by the user. Also, a single file will now only support non-cyclic type references.
  • Numeric literals can contain underscores between digits.
  • Weak references in PHP 7.4 will allow the programmers to retain a reference to an object that does not prevent the object from being destroyed.
  • Users can now throw exceptions from __toString(). This was previously not permitted in PHP as it used to result in a fatal error.
  • The CURLFile now supports stream wrappers in addition to plain file names.
  • The FILTER_VALIDATE_FLOAT filter will support the min_range and max_range options, with the same semantics as FILTER_VALIDATE_INT.
  • A new FFI extension is introduced. It will provide a simple way to call native functions, access native variables, and create/access data structures defined in C libraries.
  • A new IMG_FILTER_SCATTER image filter is added to introduce a scatter filter to images.

Read More: The Union Types 2.0 proposal gets go-ahead for PHP 8.0

Users are happy with the new features in PHP 7.4 release.

To know the full list of changes, head over to the PHP archive page. Users can also check out the PHP manual to learn how to migrate from PHP 7.3.x to PHP 7.4.x.

Read Next

PEAR’s (PHP Extension and Application Repository) web server disabled due to security breach

Symfony leaves PHP-FIG, the framework interoperability group

Google App Engine standard environment (beta) now includes PHP 7.2

Redox OS will soon permanently run rustc, the compiler for the Rust programming language, says Redox creator Jeremy Soller

Homebrew 2.2 releases with support for macOS Catalina

Vincy Davis

A born storyteller turned writer!

Share
Published by
Vincy Davis

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago