Welcome back to PHP Core Roundup series! This is post #15, where we highlight and celebrate the improvements made to PHP during the month past by the PHP development team, members of the PHP Foundation, and more.
The PHP Foundation is a collective of PHP contributors, veterans, and companies that collaborate to ensure the long-term sustainability of the PHP programming language. The foundation currently supports six contributors focused on PHP's maintenance, debt reduction, and feature development. These contributors work closely with others on coding, documentation, and discussions.
Started over a year ago, the PHP Core Roundup series offers a summary of the latest developments, discussions, and news about PHP Core, contributed by both PHP Foundation members and other participants. This post is the thirteenth in the PHP Core Roundup series.
On July 18, PHP 8.3 branch reached its feature-freeze. As the name suggests, the list of features we plan to ship with PHP 8.3 is now frozen. Contributors who wish to make substantial changes to PHP should now target the next PHP version, PHP 8.4.
In the coming weeks, the PHP Foundation members, the PHP development team, and contributors will be making improvements to get PHP 8.3 ready for production release.
Release managers elected for PHP 8.3, Pierrick Charron, Jakub Zelenka, and Eric Mann will have the final say in case a major change must be made to the PHP 8.3.
The second beta release of PHP 8.3 was released this week. Now would be an ideal time to test your PHP applications on PHP 8.3.
Compiled Windows binaries are available at windows.php.net/qa, Docker images are available at Docker Hub, and source code at php/php-src repository on GitHub to compile yourself. On Homebrew, PHP 8.3.0-dev packages are available from shivammathur/php tap.
CI/CD platforms that use Docker images can use the PHP 8.2 docker images available with various base images. GitHub Actions can also make use of shivammathur/setup-php action, which supports PHP 8.3 builds.
The PHP development team released two new versions in July 2023:
PHP 8.2.8 and PHP 8.1.21
These releases include bug fixes across various components such as CLI, Core, Curl, DOM, Opcache, OpenSSL, PGSQL, Phar, SPL, and Standard.
Changes and improvements to PHP are discussed, reported, and voted on by the PHP Foundation Team, the PHP development team, and contributors. Bug reports are made to the PHP issue tracker, changes are discussed in mailing lists, minor code changes are proposed as pull requests, and major changes are discussed in detail and voted on as PHP RFCs. Documentation and the php.net website changes are also discussed and improved at their relevant Git repositories on GitHub.
Hundreds of awesome PHP contributors put their efforts into improvements to the PHP code base, documentation, and the php.net website. Here is a summary of some changes made by the people behind PHP. Things marked with 💜 are done by the PHP Foundation team.
PHP's PDO extension supports connecting to multiple database software by using different database drivers available. Some of these drivers include MySQL, PostgreSQL, and SQLite. Although most of these database support a common set of features, all of these databases have evolved to provide additional features that PDO sometimes can support, but there is no easy way for a library to check for these capabilities without having to inspect the driver and their versions.
This RFC proposes to create driver-specific sub classes of \PDO, so libraries and applications can easily indicate the database driver they expect, and make use of IDE autocompletion and proper error handling.
The vote was unanimously accepted, and is pending implementation.
This RFC proposes to deprecate a number of functions that have overloaded signatures, meaning they behave differently based on the number or type of arguments passed to them. The goal is to make PHP's function signatures more consistent and predictable.
The aim is to clean up some of the older, less consistent parts of PHP to make the language more reliable and predictable. The following list provides a short overview of the functionality targeted for deprecation:
$widths to mb_strimwidth()NumberFormatter::TYPE_CURRENCY constantMT_RAND_PHPldap_connect with 2 parametersPHP 8.3 will have a new attribute #[\Override]. If this attribute is added to a method, the engine will validate that a method with the same name exists in a parent class or any of the implemented interfaces. If no such method exists, a compile time error will be emitted.
The similar concepts exist in Java, TypeScript, C++, C#, Swift, Kotlin, and other languages.
This RFC proposed several improvements to normalize the behavior of $v++ and $v-- to be the same as $v += 1 and $v -= 1, which PHP is currently inconsistent on.
It deprecates certain patterns, and introduces two new functions named str_increment and str_decrement to provide the deprecated behavior in a conscious way.
Following are some changes that did not go through an RFC process because they are either planned, bug fixes, or progressive enhancements.
Commits are in the order they were added, grouped by author in alphabetical order.
ldap_connect with two parameters in GH-5177zend_eval_const_expr() in GH-11424gc_status() in GH-11523XMLReader::open or XMLReader::XML non-statically with observer active) in cad47be8b6ext/intl: intl_CharFromString using zend_string_truncate to adjust th… in GH-11575zend_call_stack_get implementation for OpenBSD. in GH-11578zend_gdb disable gdb detection for FreeBSD < 11 in 69b4360e88DatePeriod::createFromISO8601String method emit DateTimeImmutable objects in 82ff4c5e84zend_string API in eb5cc1372czend_string API" in a342138e17ext/posix: posix_isatty() fix use-of-uninitialized-value in GH-11676ext/intl: Fix memory leak in MessageFormatter::format() in GH-11658mb_strimwidth() in af3c220abbNumberFormater::TYPE_CURRENCY constant in d65251e6e8libxml_get_external_entity_loader(): test for incompatible resource being loaded in GH-11728ext/mysqli: Remove custom sys_get_temp_dir() function in 17a80eb08bext/mysqli: Remove conditional function declaration in 0c21715935ext/mysqli: Stop using global variable in connection test helper in 8582d97b8cext/mysqli: Remove catchable fatal error handler in b389846d05ext/zip arginfo.h in 73cf12d6acgh11498.phpt on MSAN in 07dd0c80a8zend_constant struct (#10954)"" in ad1b70d67exleak tests on asan in GH-11610bug-gh11600.phpt in 57229836d4php_posix_stream_get_fd in GH-11694zend_constant struct (#10954)" in GH-11604open_basedir paths on ini update in GH-10987hash_pbkdf2 options parameter in GH-11731FFI::cdef()->new() in GH-11751open_basedir leak in GH-11780calendar_clear_variation1.phpt in GH-11801array_column in 2053af6628password_needs_rehash() and password_hash() in a145b40fa6ext/pgsql in 82aa4253f1number_format() Support rounding negative places in GH-11487number_format() in GH-11584zend_constant struct (#10954)" in 9f4bd3040dext/ffi internal class constants in 6988973bc6DatePeriod::createFromISO8601String() in 9c7c0a0b93dba_fetch() with $dba at the 3rd parameter in 134441efa9FFI::cast(), FFI::new(), and FFI::type() statically in 4acf0084dcget_class() and get_parent_class() without arguments in 1126232053IntlCalendar::setDate() and IntlCalendar::setDateTime() in f236eb83b4IntlGregorianCalendar::createFromDate() and IntlGregorianCalendar::createFromDateTime() in 1486f52a12ldap_connect_wallet() in 72aada3c7cldap_exop_sync in b3bd55f244pg_fetch_result(), pg_field_prtlen() and pg_field_is_null() nullable in 7ae0273ba3Phar::setStub(resource $stub, int $length) in 840d665583ReflectionMethod::createFromMethodName() in f41220fe5dReflectionProperty::setValue() with an incorrect 1st arg type in d9a7f6741estream_context_set_options() in a5ad7e09d5ext/snmp internal class constants in 1dcac9619cmb_str_pad causes access violation in 78d98e50c4ext/dom and ext/libxml in 87e7b61d8fftp_nb_fget in GH-11606ZEND_GET_CLASS and ZEND_GET_CALLED_CLASS in 838d80e7eeZEND_STRLEN in 3d944a367eDOMElement::replaceWith() doesn't replace node with DOMDocumentFragment but just deletes node or causes wrapping <></> depending on libxml2 version in GH-11627bug77020.phpt tries to send mail in GH-11636proc_nice_basic.phpt only works at certain nice levels in GH-11635php_dom_iterator_move_forward() in a2fde39169php_libxml_node_decrement_resource() in 75229cb127bug-gh11600.phpt to work with different ICU versions in 9c47f33a5fDOMNode::contains() in ea794e9cdeDOMElement::getAttribute() in f04e5059bbdom_node_node_name_read() to avoid double allocation in b3899eb569DOMElement::getAttributeNames() in 10d7e8dc3aDOMNode::getRootNode() in GH-11693DOMElement::className in GH-11691DOMParentNode::replaceChildren() in 6560c9bf8eDOMElement::id in GH-11701DOMNode::isConnected and DOMNameSpaceNode::isConnected in GH-11677DOMNode::parentElement and DOMNameSpaceNode::parentElement in GH-11679DOMNode::isEqualNode() in GH-11690DOMElement::insertAdjacent{Element,Text} in GH-11700DOMElement::toggleAttribute() in GH-11696opcache_get_status() / phpinfo() is wrong in GH-11717ZEND_RC_DEBUG=1 in GH-11757DOMElement::setAttributeNodeNS() in GH-11776DOMCharacterData::replaceWith() with itself in GH-11770DOMDocument::xmlStandalone in GH-11793XLEAK XML_SAVE_NO_DECL test for old libxml2 versions in 655f116be5PHP_HASH variable in GH-11653time.h and HAVE_TIME_H in GH-11726ZEND_STACK_GROWS_DOWNWARDS constant in GH-11762ZipArchive::FL_RECOMPRESS constant is deprecated in d8dd72fc31ZipArchive::LENGTH_TO_END and ZipArchive::LENGTH_UNCHECKED constants in 0893b4bed5PDO::ATTR_STRINGIFY_FETCHES should return strings even in if PDO::ATTR_EMULATE_PREPARES is enabled in GH-11622ext/gettext: resolve underqouting that breaks with autoconf 2.72 in GH-11427
We are incredibly grateful for the commitment and dedication of all contributors. Stay tuned for next month's roundup as we continue to make PHP better together.
At PHP Foundation, we support, promote, and advance the PHP language. We financially support six part-time PHP core developers to contribute to the PHP project. You can help support PHP Foundation at OpenCollective or via GitHub Sponsors.
A big thanks to all our sponsors — PHP Foundation is all of us!
Follow us on Twitter @ThePHPF to get the latest updates from the Foundation.
💜️ 🐘
PHP Roundup is prepared by Ayesh Karunaratne from PHP.Watch, a source for PHP News, Articles, Upcoming Changes, and more.