# New and Extended Functionality

> Chapter of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/>

## In this section

- [Error Handling](https://php7explained.com/new-and-extended-functionality/error-handling/index.html.md): How PHP 7 changes error handling: engine exceptions replace the PHP 5.6 workaround of an error handler that converts errors into ErrorException objects.
- [Type System](https://php7explained.com/new-and-extended-functionality/type-system/index.html.md): Strong versus weak, static versus dynamic, and explicit versus implicit typing, and how PHP adds optional type declarations step by step up to PHP 7.4.
- [Language Features](https://php7explained.com/new-and-extended-functionality/language-features/index.html.md): New language features of PHP 7, including preloading, FFI, arrow functions, generators, anonymous classes, the ?? and <=> operators, and weak references.
- [Constants](https://php7explained.com/new-and-extended-functionality/constants/index.html.md): New and extended constant features in PHP 7: additional global constants, arrays as constant values, and visibility modifiers for class constants.
- [Strings](https://php7explained.com/new-and-extended-functionality/strings/index.html.md): New string functionality in PHP 7: negative string offsets, counted from the right, for the [] operator and for additional string functions.
- [Arrays](https://php7explained.com/new-and-extended-functionality/arrays/index.html.md): Array additions in PHP 7, from the short list syntax, keys and references in list() to array_key_first(), array_key_last(), and the spread operator.
- [Mathematics](https://php7explained.com/new-and-extended-functionality/mathematics/index.html.md): Mathematical additions in PHP 7: consistent 64-bit support across platforms, the intdiv() function, and GMP functions such as gmp_random_seed().
- [Graphics](https://php7explained.com/new-and-extended-functionality/graphics/index.html.md): Graphics-related additions to the GD extension in PHP 7: four new image functions in PHP 7.2 and WebP support in imagecreatefromstring() in PHP 7.3.
- [Internationalisation and Unicode](https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/index.html.md): Internationalization and Unicode features added in PHP 7: the Unicode code point escape syntax, new mbstring functions, and additions to intl.
- [Regular Expressions](https://php7explained.com/new-and-extended-functionality/regular-expressions/index.html.md): Changes to regular expressions in PHP 7: PCRE JIT compilation, the move to PCRE2, preg_quote() escaping of #, and preg_replace_callback_array() with flags.
- [Session Management](https://php7explained.com/new-and-extended-functionality/session-management/index.html.md): Session handling improvements in PHP 7: options for session_start(), session IDs generated without hashing, and session_gc() for on-demand cleanup.
- [I/O and Filesystem](https://php7explained.com/new-and-extended-functionality/io-and-filesystem/index.html.md): I/O and filesystem additions in PHP 7, including dirname() levels, zlib stream compression, PDO and PHP-FPM features, and better parity on Windows.
- [Cryptography and Security](https://php7explained.com/new-and-extended-functionality/cryptography-and-security/index.html.md): Security and cryptography enhancements in PHP 7, among them Argon2 password hashing, safer unserialize(), random_bytes(), libsodium, and SameSite cookies.
- [Reflection API](https://php7explained.com/new-and-extended-functionality/reflection-api/index.html.md): PHP 7 extends the Reflection API to introspect scalar type declarations, return type declarations, generator functions, and references at runtime.
- [Date and Time](https://php7explained.com/new-and-extended-functionality/date-and-time/index.html.md): Date and time additions in PHP 7: DateTime::createFromImmutable(), the hrtime() monotonic timer, and fractional seconds from MySQL prepared statements.
- [LDAP](https://php7explained.com/new-and-extended-functionality/ldap/index.html.md): PHP 7.3 improves ext/ldap with functions such as ldap_add_ext() and ldap_exop_refresh(), full support for LDAP Controls, and a serverctrls parameter.

---

Previous: [More Facepalms](https://php7explained.com/backward-incompatible-changes/deprecated-features/more-facepalms/index.html.md) | Next: [Error Handling](https://php7explained.com/new-and-extended-functionality/error-handling/index.html.md)
