- Support for VT100 Console Mode
As of PHP 7.2, ANSI escape sequences for colored console output also work on Windows 10, starting with build 10586, thanks to VT100 console mode support.
- Optional Level Parameter for
dirname()
PHP 7 adds an optional second parameter to dirname() that specifies the number of directory levels to go up; it must be a positive integer.
- Specifying the
zip Compression Method
PHP 7 lets you set the compression method for each item in a zip archive with ZipArchive::setCompressionName() and ZipArchive::setCompressionIndex().
- Stream-Based Compression
PHP 7 adds deflate_init(), deflate_add(), inflate_init(), and inflate_add() to the zlib extension for compressing and uncompressing data incrementally.
- Output Buffering and
ignore_user_abort()
PHP 7 fixes a bug introduced in PHP 5.4 that discarded the output buffer when the client aborted a request, relevant when ignore_user_abort is used.
- New function
stream_isatty()
As of PHP 7.2, stream_isatty() tells CLI applications whether a given resource is a terminal (TTY), returning true if it is and false otherwise.
- Stream Context Option on Windows
PHP 7 introduces a stream context option that only works on Windows: setting blocking to true for pipe allows blocking reads on pipes.
- Debugging PDO Prepared Statement Emulation
PHP 7.2 adds PDOStatement::activeQueryString(), which returns the current SQL query string to help debug the emulation of prepared statements in PDO.
proc_open() on Windows
proc_open() on Windows is no longer restricted to a hardcoded maximum of 16 pipes; the number of pipes is now limited only by the available memory.
proc_nice() on Windows
As of PHP 7.2, the proc_nice() function for changing the priority of the process that runs the current PHP script is also available on Windows.
getrusage() on Windows
Since PHP 7, getrusage() is also supported on Windows, where it returns information about the user time and system time spent by the running script.
memory_limit on Windows
Discusses the claim that PHP 7 on Windows now supports the memory_limit php.ini directive, which the authors could neither confirm nor deny.
- File Deletion on Windows
Since PHP 7.3, file descriptors on Windows are opened in shared read/write/delete mode by default, which allows deleting files that are still open.
- Username and Password in PDO DSN
Since PHP 7.4, username and password can be specified as part of the PDO DSN, which was previously possible only when connecting to PostgreSQL.
- New Function
fpm_get_status() in PHP-FPM
Since PHP 7.3, fpm_get_status() returns the status information of the FastCGI process manager when run inside PHP-FPM, for building advanced status pages.
getallheaders() Available in PHP-FPM
As of PHP 7.3, the getallheaders() function for retrieving all request headers sent by the client is also available when PHP runs under PHP-FPM.
- New Configuration Settings in PHP-FPM
PHP-FPM gains three configuration options: log_limit for the maximum log line size, log_buffering, and decorate_workers_output for worker output.