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. Started over a year ago, the PHP Core Roundup series deliver a summary of the latest developments, discussions, and news about PHP Core made by both PHP Foundation members and other contributors. This post is the twelfth in the PHP Core Roundup series.
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.
PHP 8.3 Release Managers Elected
Release managers for PHP 8.3 were elected from a vote that ended on April 16.
Pierrick Charron, one of the PHP 8.2 release managers stepped in to be the veteran release manager, and Jakub Zelenka π and Calvin Buckley were elected as the "rookie" release managers. Jakub Zelenka is one of the PHP Foundation members.
Release managers are responsible for triaging bugs and security vulnerabilities, signing and releasing tagged PHP releases, communication, and other management tasks until the PHP version reaches its End-Of-Life.
Discussions on PHP Governance and Communication
During the last month, there were several mailing list discussions about PHP governance and communication. These lengthy discussions lead to an RFC (currently in vote) to form a "PHP Technical Committee", and a discussion on moving PHP Internals mailing list to GitHub issues and discussions.
While the PHP Foundation seeks the long-term sustainability of the PHP project by funding full-time and part-time PHP contributors and acting as a collective for other PHP initiatives, the RFC for the technical committee and the discussion on moving the PHP Internals mailing list to GitHub remained the discussion of all PHP contributors.
The Technical Committee RFC intends to form an elected group of PHP contributors who will focus on PHP internal changes. User-facing changes such as PHP APIs would still go through the current RFC voting process. RFC discussion and an in-vote discussion provide more context. Jakub also emailed the PHP Internals with Current RFC process and project decisions to provide more information.
Moving PHP internals to GitHub is also a lengthy discussion on highlighting some of the flaws of the current mailing list approach to discussions, and proposing to use GitHub Discussions and issues for the communication amongst PHP contributors and users.
Recent RFCs and Mailing List Discussions
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.
RFC Updates
Following are the RFCs and major pull-requests discussed, voted on, and implemented since our last update.
RFC In Vote: PHP Technical Committee by Jakub Zelenka π and Larry Garfield
As mentioned above, proposes to establish a technical committee to take decisions on PHP internal API changes and other technical aspects.
RFC Under Discussion: Deprecate functions with overloaded signatures by MΓ‘tΓ© Kocsis π
PHP does not support method overloading similar to Swift or Java. However, there are some internal PHP functions and methods that accept multiple function/method signatures that behave differently. For example, the
session_set_save_handlerfunction accepts severalcallableparameters or a singleSessionHandlerInterfaceimplementation.While there are historical reasons for those internal functions to provide multiple signatures, part of of the long-term language streamlining goals of PHP is to get rid of these inconsistencies. This RFC proposes to deprecate several overloaded functions and methods. For each of the deprecated signatures, the RFC proposes a new function or a method, or to eventually remove the deprecated signature in the next major PHP version (PHP 9.0 as for now).
RFC Under Discussion: Clone with by MΓ‘tΓ© Kocsis π
Proposes a new "clone with" construct to PHP to address to too strict nature of
readonlyproperties. As of PHP 8.2,readonlyproperties can be too strict and do not provide the means to create immutable objects that remain immutable at an object level, because cloned objects remain read-only too.class Response implements ResponseInterface { public readonly int $statusCode; public readonly string $reasonPhrase; // ... public function withStatus($code, $reasonPhrase = ''): Response { return clone $this with { statusCode: $code, reasonPhrase: $reasonPhrase }; } // ... } $response = new Response(200); $response->withStatus(201)->withStatus(202);
RFC Under Discussion: New core autoloading mechanism with support for function autoloading by Gina Peter Banyard π and Dan Ackroyd
PHP has had support for class autoloading since PHP 5 and it is an extremely useful feature that is relied on to only load classes that are being used within the current request. However, the current autoloading mechanism does not support autoloading functions.
The need for such a feature seems very clear as users will create βhelperβ classes with static methods to take advantage of autoloading via the class autoloading mechanism.
The proposal consists of adding a better designed class autoloading mechanism and a new function autoloading mechanism, and aliasing the existing autoload functions to the new versions. The proposal does not include a default implementation for either the class or the function autoloading mechanism.
Eight newly proposed
autoload_(register|unregister|call|list)_(class|function)functions will be used to register, unregister, call, and list autoloaders for both classes and functions. Existingspl_*functions are proposed to be aliased to the new functions.Further,
function_existswill get a new parameter$autoloadsimilar toclass_exists()to trigger the autoloader if necessary.RFC Accepted : Arbitrary static variable initializers by Ilija Tovilo π
PHP does not allow using arbitrary expressions in static variable initializers because the values are initialized at the compile time. This also lead to some unexpected behaviors when the same variable is initialized in more than once within the same scope.
This RFC proposes to remove the current limitation of not allowing expressions in static variable initializers. It also forbids redeclaring static variables altogether.
function foo() { static $i = getValue(); }This RFC was accepted by the vote, and will be implemented in PHP 8.3.
RFC Implemented: Make unserialize() emit a warning for trailing bytes by Tim DΓΌsterhus
This RFC proposes that
unserialize()shall emit a newE_WARNINGwhenever the input string contains additional bytes once the unserialization parser terminates after successfully parsing a value. In other words: A warning shall be emitted if bytes can be removed from the end of the input string without changing the return value ofunserialize().The RFC vote unanimously accepted this change, and it is already implemented for PHP 8.3.
Notable Mailing List Discussions
- Final anonymous classes
- [Discussion] Callable types via Interfaces
- Expansion of PHP Symbols?
- Future stability of PHP?
- Moving PHP internals to GitHub
- Brainstorming idea: inline syntax for lexical (captured) variables
- Possible RFC:
$_SERVER['REQUEST_TIME_FLOAT'] - [RFC] PHP Technical Committee
- Array spread append
- PHP Modules
- Property Hooks Discussion
Merged PRs and Commits
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.
Full list of commits since PHP Core Roundup #11
Click here to expand
- Fix GH-8841: php-cli core dump calling a badly formed function in GH-10989 by Niels Dossche
- Fix GH-10990:
mail()throwsTypeErrorafter iterating over$additional_headersarray by reference in GH-10991 by Niels Dossche - Fix GH-10983: State-dependant segfault in
ReflectionObject::getPropertiesin GH-10984 by Niels Dossche - Remove
XFAILfrom test cases formb_strcutwhen used with JIS or ISO-2022-JP encoding in c211e67b4e by Alex Dowad - Add ASAN
XLEAKsupport in GH-10996 by Ilija Tovilo π - Fix
add_function_array()assertion when op2 contains op1 in GH-10975 by Ilija Tovilo π - Add
zend_allocXLEAKsupport in GH-10999 by Ilija Tovilo π - Tracing JIT: Fixed incorrect code generation for SEND-ing of result of ASSIGN to typed reference in 8a749c79d0 by Dmitry Stogov
- Fix incorrect error handling in
dom_zvals_to_fragment()in GH-10981 by Niels Dossche - Add forgotten upgrading note for the Readonly amendments RFC in 0a169cbd5b by MΓ‘tΓ© Kocsis π
- Remove name field from the
zend_constantstruct in GH-10954 by MΓ‘tΓ© Kocsis π - Cleanup pubkey checks in
ext/pharin GH-11009 by Niels Dossche - [Zend]: Fix unnecessary alignment in
ZEND_CALL_FRAME_SLOTmacro in GH-10988 by Tony Su - Add ngx-php to opcache supported sapis in GH-11013 by Joan Miquel
- Delay freeing of overwritten values in assignments in 915b2837f7 by Dmitry Stogov
- Add various tests for GH-10168 in f43fa59171 by Ilija Tovilo π
- Delay destructor for
zend_assign_to_typed_refin b39107c774 by Ilija Tovilo π - Delay destructor for
zend_std_write_propertyin 24acb4f134 by Dmitry Stogov - Add
GC_DTOR/GC_DTOR_NO_REFmacros in fdbea4f39e by Ilija Tovilo π - JIT support for delayed destructor for
zend_assign_to_typed_ref/propin e1c6fb76c0 by Dmitry Stogov - Add note for GH-10168 to
UPGRADING.INTERNALSin 3528ca8930 by Ilija Tovilo π - Remove includes in d5484bf115 by Dmitry Stogov
- Re-add
GC_DTORandGC_DTOR_NO_REFin c796ce5713 by Dmitry Stogov - Fix GH-9397: exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index in GH-10470 by Niels Dossche
- Add separate static property through trait if parent already declares it in GH-10937 by Ilija Tovilo π
- Use
zend_call_known_instance_method()instead of building FCI/FCC in serializer subroutine in GH-9955 by Gina Peter Banyard π - Extract common code for phar IO intercept functions in 3fb63f7fa2 by Gina Peter Banyard π
- size variable is only used once, move closer to usage in 96ffdd492c by Gina Peter Banyard π
- Improve locality of stream variable in 06896d1c45 by Gina Peter Banyard π
- Use
zend_string_concathelper instead ofstrpprintfin 8e51cfe0ae by Gina Peter Banyard π - Convert
char*+size_tparameters tozend_string*inphar_find_in_include_path()in 7d93ef067f by Gina Peter Banyard π - Add FPM FastCGI env var test for Apache without path info fix in 15802dfc62 by Jakub Zelenka π
- Fix number of elements after packed hash filling in GH-11022 by Niels Dossche
- Fix GH-11016: Heap buffer overflow in
ZEND_ADD_ARRAY_UNPACK_SPEC_HANDLERin GH-11021 by Niels Dossche - Add FPM FCGI env Apache handler UDS test in ebb3213f79 by Jakub Zelenka π
- Fixed tests and remove the
XFAIL'Various bugs exist'. They did, but they were in the tests in e67bb14ab4 by Derick Rethans π - Fix GH-10737: PHP 8.1.16 segfaults on line 597 of
sapi/apache2handler/sapi_apache2.cin GH-10863 by Niels Dossche - Use
zend_stringfor DBA path in GH-10698 by Gina Peter Banyard π ext/socketsadding FreeBSD'sSO_REUSEPORT_LBconstant in 6c532df705 by David CARLIER- Add case insensitive versions of the
zend_string_starts_with_*APIs in GH-11032 by Gina Peter Banyard π ext/phar: Prevent unnecessary known string length computation in GH-11033 by Gina Peter Banyard πext/phar: Remove duplicate cleaning-up code in 4082d425a9 by Gina Peter Banyard π- Fix unevaluated rhs of class constant fetch in constant expression in GH-11047 by Ilija Tovilo π
- Remove unneeded occurrences of my name in
UPGRADINGin d64c7184d4 by Alex Dowad - Add more details to
NEWSonmb_detect_encoding; also include in UPGRADING in aa51871adc by Alex Dowad - Add additional note on
mb_encode_mimeheaderinUPGRADINGin a62d192ede by Alex Dowad - Add more details in
UPGRADINGonmb_check_encodingchanges in 7cef7cb0ee by Alex Dowad - Allow
FETCH_OBJ_WandFETCH_STATIC_PROP_Wto returnINDIRECT/UNDEFzval for uninitialized typed properties in GH-11048 by Dmitry Stogov ext/curl: Protocol should be a case insensitive check in GH-11052 by Gina Peter Banyard π- Use curl from brew on MacOS CI in GH-11056 by Jakub Zelenka π
- Improve ini number handling with
INI_SCANNER_TYPEDin GH-11014 by Ilija Tovilo π ext/phar: Fix recently introduced potentialNULLdereferencement segfaults in GH-11065 by Gina Peter Banyard π- Optimize
HT_HASH_RESETin GH-11059 by Niels Dossche mb_parse_str,mb_http_input, andmb_convert_variablesuse fast text conversion code for automatic encoding detection in 6df7557e43 by Alex Dowad- Remove unnecessary memory clearing in virtual_file_ex() in GH-10963 by Niels Dossche
- Fix test
bug60120.phptin GH-11064 by Ilija Tovilo π xxhash.h: Fix GCC 12 -Og in GH-11062 by Mingli Yu- Add benchmarking to CI in GH-11068 by Ilija Tovilo π
- Restrict benchmarking push to php org in d126031728 by Ilija Tovilo π
- Fix commit sha in commit name in 8d5e06dc94 by Ilija Tovilo π
- Micro-optimize double comparison in GH-11061 by Niels Dossche
- Fix commit hash really this time in f4ede230cd by Ilija Tovilo π
- Fix GH-11028: Heap Buffer Overflow in
zval_undefined_cvin GH-11083 by Niels Dossche - Add
zend_test_crashfuntion to segfault PHP process in GH-11082 by Jakub Zelenka π - Benchmarking mean in GH-11085 by Ilija Tovilo π
- Fix uninitialized variable compile error in 2044e5aea0 by Ilija Tovilo π
- Fix CI benchmarking diff in af809ef028 by Ilija Tovilo π
- Add missing
zend_test_crashmessage initialization in 84be9042f9 by Jakub Zelenka π - fpm: remove 2 unneeded newlines from zlog call in 581e729e8d by Sjon Hortensius
- Support enums in array_unique in GH-11015 by Ilija Tovilo π
- Typed class constants in GH-10444 by MΓ‘tΓ© Kocsis π
ext/openssl: pass ini options to extra processes in tests in 5a4083181b by Jakub Holubansky- Fix uninitialized memory in
parse_ini_string()in GH-11092 by Ilija Tovilo π - Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension" in 31e21f7dbc by Remi Collet
- Import timelib 2022.06 in 44eef677b0 by Derick Rethans π
- Fixed tests in cc7b799c44 by Derick Rethans π
- Add NEWS entry in 1dcab8a534 by Derick Rethans π
- Fix mysql tests with non-standard server port in GH-9744 by Michael VoΕΓΕ‘ek
- Bump OCI8 version to make a PECL release for 8.2 in 91d3aaaa93 by Christopher Jones
- Fix reference returned from
CallbackFilterIterator::accept()in 5855bdcd6c by Ilija Tovilo π - Fix
-Wenum-int-mismatchwarnings on gcc 13 in GH-11103 by Ilija Tovilo π - Fix incorrect
CG(memoize_mode)state after bailout in??=in GH-11109 by Ilija Tovilo π - ci update freebsd image to the 13.2 image in GH-11110 by David CARLIER
- Import timelib 2022.07 to address OSS fuzz issue in 629d7740e8 by Derick Rethans π
ext/intl: deprecateU_MULTIPLE_DECIMAL_SEPERATORSconstant in 976d7ed4c6 by David CARLIER- Allow CTE on basic type/math functions in GH-10842 by Michael VoΕΓΕ‘ek
- Allow array functions to operate in-place if the
refcountis 1 in GH-11060 by Niels Dossche - Set
error_logto an empty value if the test relies on that feature in GH-10772 by Niels Dossche - Add test to make sure that readonly properties cannot be reassigned by invoking the
__clone()method directly in 04a5f2b11f by MΓ‘tΓ© Kocsis π - Minor conditions simplify in GH-10397 by Michael VoΕΓΕ‘ek
- Fix incorrect match default branch optimization in GH-11135 by Ilija Tovilo π
ext/sockets: addig Linux'sIP_BIND_ADDRESS_NO_PORTin 7b4b40f06f by David Carlier- Fix ZPP of
pg_lo_export()in GH-11132 by MΓ‘tΓ© Kocsis π - Fix GH-9344: pgsql pipeline mode proposal in 6a9061e0af by David CARLIER
- Propagate
STREAM_DISABLE_OPEN_BASEDIRsrc flag tophp_stream_stat_path_exin GH-11156 by Ilija Tovilo π - Allow aliasing namespaces containing reserved class names in GH-11153 by Ilija Tovilo π
- Fix uninitialised variable warning in
mbfilter_sjis.cin b915a1d8d7 by Niels Dossche - Update libenchant in arm build in 5cbc917fee by Ilija Tovilo π
Support PHP Foundation
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!
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.