Welcome back to PHP Core Roundup, the sixth in the series. PHP Core Roundup summarizes the latest improvements, bug fixes, discussions, and proposals to PHP.
The PHP Foundation currently supports six part-time PHP contributors who work on maintenance and new features for PHP. Maintenance is not limited to fixing bugs, but also includes work to reduce technical debt, making life easier for everyone working on PHP. The contributors funded by the PHP Foundation collaborate with other contributors on code, documentation, and discussions.
We publish the posts on our website, and you can subscribe to a newsletter; You don’t necessarily have to be a PHP Foundation backer to follow PHP Core Roundup.
September was a slow month, given that PHP 8.2 reached its feature-freeze, and most of the work is now focused on getting PHP 8.2 ready for its general availability, scheduled for November 24th.
Nikita Popov recently tagged three new releases of the nikic/PHP-Parser library with support for PHP 8.2 features and syntax. PHP-Parser is used as the underlying PHP parser for several PHP static analyzers, and you can expect many PHP tools to support new PHP 8.2 syntax in the coming weeks.
Although PHP 8.2 is still being ironed out, there are some discussions and even an RFC currently being voted for proposed changes in PHP 8.3 (scheduled for the end of 2023!).
Deprecations for PHP 8.3 RFC is currently in draft, which stands to track ideas on deprecating certain features. So far those are related to the mb_strimwidth function, NumberFormatter class, and a few functions related to Random Number Generators (RNG).
Furthermore, there is an RFC currently under vote to add a new function named json_validate(), that validates a given JSON string without the memory overhead of otherwise decoding the JSON string into memory.
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 web site 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 of the changes made by the people behind PHP. Things marked with 💜 are done by the PHP Foundation team.
Following are the RFCs and major pull-requests discussed, voted, and implemented since our last update.
RFC In Voting: json_validate
RFC by Juan Carlos Morales, to add a new json_validate() function that returns whether the given string of JSON is a valid JSON. PHP’s json_decode() function can emit errors or throw exceptions on strings with invalid JSON, but the proposed json_validate function will be faster and more memory efficient because it does not attempt to build the data structures in memory, but merely validate the given string.
This RFC is currently under vote, and concludes on 7th of October. The responses have been overwhelmingly positive to add json_validate to PHP 8.3.
RFC In Draft: Deprecations for PHP 8.3
RFC Christoph M. Becker and Gina Peter Banyard 💜 with suggestions from Tim Düsterhus and Go Kudo (so far!), that proposes a series of functionality/syntax to deprecate in PHP 8.3, and eventually remove in PHP 9.0.
Each proposed deprecation will be voted to determine if the deprecation makes it to PHP 8.3, but having a consolidated RFC eases the voting and discussions.
So far, the RFC proposes to deprecate the following:
$widths to mb_strimwidth()NumberFormatter::TYPE_CURRENCY constantMT_RAND_PHP constant/moderand(), mt_rand(), array_rand(), shuffle(), and str_shuffle() functions in favor of the \Random\Randomizer class introduced in PHP 8.2, or random_int()/random_bytes() functions available since PHP 7.0. Most of the applications can simply switch to random_int()/random_bytes(), and applications that rely on an existing Mersenne Twister sequence can use the scoped Mt19937 engine through the new \Random\Randomizer class.Now that PHP 8.2 is being prepared for GA releases, the documentation available on php.net, requires updating. An initial version of the PHP 8.2 migration guide has been published.
Gina P. Banyard 💜 is tracking the progress for PHP 8.2 related changes in php/doc-en#1803, and you can help too!
You can also help with other existing issues, a good starting point are issues marked as “good first issue” that George went and triaged in preparation for Hacktoberfest.
Derick has gone through all the datetime notes, and integrated them where needed, deleted where not.
Following are some changes that did not go through an RFC process because they are either planned, bug fixes, or progressive enhancements. There are automated unit and integration tests for each of these changes, the PHP core developers review all pull requests.
CONST_CS when registering constants in GH-9439 by Máté Kocsis 💜local_cert and local_pk do not respect open_basedir restriction in 505e8d2a04 by Jakub Zelenka 💜chacha20-poly1305 AEAD support in 1407968891 by Jakub Zelenka 💜openssl_cipher_key_length function in 35e2a25d83 by Jakub Zelenka 💜libxml_get_external_entity_loader() in 11796229f2 by Tim Starlinglibxml2 2.10.0 symbols in GH-9358 by Christoph M. BeckerDELETE/PUT/PATCH request on a static resource in 7065a222b7 by Vedran MiletićNEWS for CLI built-in server changes in 5e9af0d0b0 by Jakub Zelenka 💜ext/opcache/tests/jit/inc_obj_004.phpt failure introduced by fd74ee7e in ce42dcf483 by Dmitry Stogovksort behaves incorrectly on arrays with mixed keys” in 725cb4e8ad by Christoph M. BeckerDateTime::getLastErrors() not returning false when no errors/warnings in 932586c426 by Derick Rethans 💜gen_stub to avoid compile errors on duplicate function names in GH-9406 by Andreas Braunzend/test aliases in ef21bbe66c by Máté Kocsis 💜ext/zend_test alias functions in 8d78dce902 by Máté Kocsis 💜var_export/debug_zval_dump check for infinite recursion on the *object* in GH-9448 by Tyson AndreNEWS and UPGRADING entries for GH-9296 in 853181a14d by Christoph M. Beckercrypt()'s $string parameter as #[\SensitiveParameter] in c77bbf6fe5 by Tim Düsterhuspcre.jit on Apple Silicon in GH-9279 by Niklas Kellerext/random's randomizer tests in GH-9410 by Tim Düsterhusext/standard constants in stubs in GH-9465, GH-9466, GH-9505, and GH-9467 by Máté Kocsis 💜opcache.interned_strings_buffer causing shm corruption in GH-9260 by Arnaud Le Blanc 💜ext/standard/config.m4 in GH-9482 by Tim Düsterhussapi/cli/tests/017.phpt on Windows, too in GH-9474 by Christoph M. Beckerphpinfo() for opcache in GH-9475 by Mikhail Galaninphp_info_print_table_header for actual column headers only in GH-9485 by Tim Düsterhuszend_string INI validators in GH-9328 by Gina Peter Banyard 💜uspoof_check2UTF8 call when available. in GH-9478 by David CARLIERPDEATHSIG to kill cli-server workers if parent exists in GH-9476 by Ilija Tovilo 💜eval'd code referring to incorrect class for static type in GH-9471 by Ilija Tovilo 💜__get and property type inconsistency error message in GH-9436 by Ilija Tovilo 💜MemorySanitizer: use-of-uninitialized-value warning introduced by 932586c4 in 8cdfffb753 by Derick Rethans 💜error_container/NULL, but use by-ref instead in f799bc4eca by Derick Rethans 💜zend_jit_trace_get_exit_addr() in GH-9097 by Arnaud Le Blanc 💜PROGRESS_CACHE_SLOT() macro in 80315edd58 by Gina Peter Banyard 💜(A&B)|D as a param should allow AB or D. Not just A in 9286101da4 by Gina Peter Banyard 💜compact_literals.c in 6c4d24e4f0 by Gina Peter Banyard 💜gen_stub.php in 8b632749d7 by Máté Kocsis 💜gh9259_003.phpt as xfail with ASAN in e9a0d21a06 by Ilija Tovilo 💜FG(user_stream_current_filename) at the end of request in d0b3096ff0 by Dmitry StogovZEND_RC_MOD_CHECK() for thread local ini parser strings in 9af98cd465 by Ilija Tovilo 💜_xml_add_to_info() in 0b8ad94b91 by Gina Peter Banyard 💜_xml_decode_tag() as taking a const XML_Char* in 6aef13402e by Gina Peter Banyard 💜xml.c in 951bd74038 by Gina Peter Banyard 💜oci_success_with_info.phpt test random failures in GH-9525 by Michael Voříšekstrtotime translates a date-time with DST/non-DST hour differently based on default timezone in e5b4624b8b by Derick Rethans 💜const for fixed API in f8b27c73c9 by Derick Rethans 💜NEWS in 0f9351669b by Derick Rethans 💜LIBZIP_VERSION constant def from stub in 946cdb8ad1 by Remi ColletSplFixedArray in 70ad93dd6e by Nikita Popovext/date/tests/gh-124.phpt on ASAN in dbbb7427be by Ilija Tovilo 💜file_cache_only=1 in GH-9550 by Ilija Tovilo 💜DEBUG_NTS_OPCACHE Without interned strings" build in ac54bfb17c by Arnaud Le Blanc 💜POSIX_RLIMIT_FSIZE and gcov in 3f1e9235e1 by Ilija Tovilo 💜NULL in GH-9559 by Ilija Tovilo 💜dl(mysqli) issue with OPcache on AppVeyor in GH-9557 by Christoph M. Beckerfileinfo: magic: Backport mime type support for woff/woff2 fonts in 34fa65a6c2 by Anatol BelskiSOCKET_EPROTO constant missing since PHP 8.2 dev in GH-9575 by Christoph M. BeckerTEST_PHP_DIFF_CMD env var is set in d7d6794f94 by Derick Rethans 💜Randomizer::getBytes() in GH-9563 by Joshua RüswegENABLE_TEST_CLASS check in 0b2fe40d23 by Nikita PopovPS(mod_user_class_name) must not leak into next request in 3071d85a6b by Ilija Tovilo 💜parse_url(): can not recognize port without scheme” in GH-9569 by Andy Postnikovfrom → form) in GH-9609 by Christoph M. Becker--repeat 2 job to GitHub actions in 2cf7d70e53 by Ilija Tovilo 💜libmysqlclient job to GitHub actions in GH-9608 by Ilija Tovilo 💜fileinfo: tests: Disable times sensitive tests on debug build in cab2f05f5a by Anatol Belskitravis_wait to travis for test.sh in 8c20ad1081 by Ilija Tovilo 💜SA_ONSTACK in zend_sigaction in GH-9597 by Kévin DunglasFFI::addr() when referencing temporary pointer in GH-9601 by Ilija Tovilo 💜CFLAGS for community build in 12afd0cba8 by Ilija Tovilo 💜init_fcall guards in ca93e48b77 by Dmitry Stogovrun-tests.php for explicitly given test cases in GH-9617 by Christoph M. Beckerbug81726.phpt for PHP 8.0 in GH-9621 by Christoph M. Beckerbug81726.phpt for PHP 8.0 in 809176dab0 by Christoph M. Beckerzend_try to recover in case of memory overflow in 2568db287d by Dmitry Stogov} in GH-9624 by Ilija Tovilo 💜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.
A big thanks to all our sponsors — PHP Foundation is all of us!
A special mention goes to mailcoach.app for providing us with a platform for the newsletter.
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.