Welcome to the eleventh post in the PHP Core Roundup series. Just like the previous months, March was an eventful month with new RFCs, discussions, and plenty of other developments in 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.
In February, Sergey Panteleev β one of the PHP 8.2 release managers β called for volunteers to put their names forward to be the release managers for the upcoming PHP 8.3. Four volunteers stepped in for the three available positions, and a vote is currently under way.
Pierrick Charron, one of the PHP 8.2 release managers, volunteered to be the veteran release manager. Pierrick will be working with two newcomers to this position throughout the lifecycle of PHP 8.3.
For the rookie candidates, Eric Mann, Calvin Buckley, and Jakub Zelenka π expressed their interest, and the vote will elect two release managers from this list of three.
Voting will be open until Apr 16, 2023.
PHP 8.2.4 and 8.1.17 are now released, both of which contain over 45 bug fixes (and no security fixes).
PHP 8.0 only receives security updates, so there is no corresponding release for PHP 8.0.
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.
Following are the RFCs and major pull-requests discussed, voted on, and implemented since our last update.
RFC Implemented: Saner array_(sum|product)() by Gina Peter Banyard π
Proposed to change the current behavior of array_sum
and array_product
to properly handle non-numeric values. This results in additional warnings when these functions encounter unsupported types such as certain objects, arrays, and resources. Further, it can result in different return values on objects that support arithmetic operations.
This RFC was accepted, and the changes are now implemented in PHP 8.3.
RFC Implemented: Typed class constants by Benas Seliuginas and MΓ‘tΓ© Kocsis π
Despite the huge efforts put into improving the type system of PHP year after year, it was still not possible to declare constant types. This is less of a concern for global constants, but can indeed be a source of bugs and confusion for class constants: This RFC proposed to add support for declaring class, interface, trait, as well as enum constant types:
enum E {
const string TEST = "Test1";
}
trait T {
const string TEST = E::TEST;
}
interface I {
const string TEST = E::TEST;
}
class C {
const string TEST = E::TEST;
}
This RFC was accepted, and the changes are now implemented in PHP 8.3.
RFC In Voting : 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();
}
The code snippet will be allowed and functional in PHP 8.3 if the RFC is accepted. The RFC is currently under vote, and the current tally us an unanimous Yes.
RFC Under Discussion: Make unserialize() emit a warning for trailing bytes by Tim DΓΌsterhus
This RFC proposes that unserialize()
shall emit a new E_WARNING
whenever 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 of unserialize()
.
RFC Under Discussion: Define proper semantics for range() function by Gina Peter Banyard π
This RFC attempts to iron out several undesirable and unexpected behaviors of the range()
function. Introduced in PHP 4, range()
function attempts to work with various types not only including integers, floats, and strings, but also other types. There are series of behaviors highlighted in the RFC along with several improvements proposed (throwing exceptions, emitting warnings, changing behaviors, etc).
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.
ext/spl
where appropriate (#10734) in 2b15061fbb by Niels DosscheCK()
macro to check the output function in mbfilter_unicode2sjis_emoji_sb() in 263655a520 by nielsdosmbfl_filt_conv_illegal_output()
in d66ca5dabb by nielsdosZEND_ARG_VARIADIC_OBJ_TYPE_MASK
macro, and use consistent class_name variable name in 7fcea9d260 by Derick Rethans πext/ftp
fix ftp_nb_get signature (for failure) in GH-10760 by David Carlierphp_random_(bytes|int)_(silent|throw)
into inline functions (#10763) in 8abea1b3c2 by Tim DΓΌsterhusmb_check_encoding
on 32-bit MS Windows in 86ec0bc55c by Alex Dowadstrlen
error message param name in 1be99faeff by Kamil Tekielacheckout@v3
in 28ef654648 by Ilija Tovilo π-Warray-bounds
compiler warning in JIT (#10789) in ad7b90b674 by Ilija Tovilo π-Wmaybe-uninitialized
warning in JIT in 95fbd2039f by Ilija Tovilo πzend_API.c
with --disable-debug
(#10786) in 6a7115359e by Ilija Tovilo πEVP_MD_CTX_create()
and EVP_VerifyInit()
in GH-10762 by Niels Dosschei2d_PKCS12_bio()
in GH-10761 by nielsdosPEM_write_bio_CMS()
in 51ea4a680d by nielsdosPEM_write_bio_PKCS7()
in GH-10752 by Niels DosscheFAILURE
in 2110398dee by Ilija Tovilo πEXPECTHEADERS
sections in 87e3513274 by Ilija Tovilo πphp.h
include to php_random.h
(#10764) in 5087931963 by Tim DΓΌsterhus-Wstrict-prototypes
in DBA in 648e896d0e by Gina Peter Banyard πmb_encode_mimeheader
does not crash if provided encoding has no MIME name set in 7c1ee5a02a by Alex Dowad*/*.m4
: update main()
signatures in fa65873502 by Michael Orlitzkyext/iconv/config.m4
: add missing stdio.h
include in GH-10751 by Michael Orlitzkyarray_(sum|product)()
(#10161) in 3b06618813 by Gina Peter Banyard πopcache.c
onsistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context in GH-10798 by Niels Dossche-Wstrict-prototypes
in GD extension (#10803) in afd8695a22 by Gina Peter Banyard πext/intl
: dateformatter settimezone changes on success, returning true like setcalendar in GH-10790 by David CarlierGC_BENCH
flag (#10823) in 6f1e5ff8c3 by Ilija Tovilo π-Wstrict-aliasing
in GH-10821 by Ilija Tovilo πmysqli_api.c
in 47f80ffc77 by Ilija Tovilo π__get
in GH-10833 by Ilija Tovilo πzend_execute_internal
in JIT in c53e8d3e30 by Bob Weinandext/mysqli/pgsql
: mysqli_fetch_object
/pgsql_fetch_object
raises ValueError
on constructor args error in GH-10832 by David Carlieruse_tls=0
on MSAN
in GH-10851 by Ilija Tovilo πmb_encode_mimeheader
using fast text conversion filters in 0ce755be26 by Alex Dowadphp_pgsql_meta_data
raises a ValueError
when table name is invalid in 394470c052 by David Carlierext/mysqi
: mysqli_poll raises a ValueError on absent 1st and 2ng arguments in 90a39fd52c by David CarlierSQLAllocHandle
in GH-10740 by nielsdosarray_diff_ukey()
, which was added by mistake in GH-10859 by Michael VoΕΓΕ‘ekmaster
in 471105abd7 by Ilija Tovilo πpgsql_insert
fix unit tests (#10860) in feb82d91b9 by David CARLIERzend_hash
: Use AVX2 instructions for better code efficiency (#10858) in d835de1993 by Tony Su$scriptName
logic in 7d987ebbbf by Jakub Zelenka πxfail
from tests that do not fail anymore (#10871) in 53763e14b7 by Arnaud Le Blanc πext/psql
: pg_meta_data
, extended mode, fix typo for pseudo typtype in GH-10865 by David CARLIERfile_handle
in fpm_main
in GH-10707 by Niels DosscheNUL
byte in exception string terminating Exception::__toString()
in GH-10873 by Ilija Tovilo πext/random
in e73d8de784 by Tim DΓΌsterhusext/ffi
, ext/opcache
and the core Zend files in b698108133 by Dmitry Stogovext/date
in b5262218d4 by Derick Rethans πrun-tests.php
in GH-10875 by Ilija Tovilo πext/curl
: suppress -Wdeprecated-declarations in curl_arginfo.h
in 2646d76abc by Max Kellermannext/pdo_sqlite
: simplifying sqlite3_exec usage. (#10910) in 54f92fc333 by David CARLIERrun-tests.php
differ in c58c2666a1 by Ilija Tovilo πphp_fgetcsv()
with \0 delimiter and enclosure in GH-10923 by Ilija Tovilo π--with-valgrind
by default (#10934) in 5eb6905405 by Ilija Tovilo πext/pdo_mysql
: mysql_handle_closer nullify some freed data in f6989df8cc by David CARLIERopen_basedir()
in a7f91e37de by Ilija Tovilo πphp_random_bytes_silent()
where possible in gmp_init_random() (#10944) in 8317a147b9 by Niels DosscheGENERATE_SEED()
in GH-10942 by Niels Dossche--with-opcache-capstone
to --with-capstone
(#10952) in b73b70f097 by Ilija Tovilo πSplFixedArray::__serialize
in GH-10925 by Niels DosscheSplFixedArray::__serialize
" in 0d524eda94 by Niels Dosscheext/posix
: proposing posix_eaccess. unlike access, it is not standard but available in enough platforms ; on linux it's euidaccess in reality eaccess being 'just' an alias. key difference is eaccess checks the effective user id instead in 2b354318d9 by David CARLIERext/intl
: breakiterator::setText returns false on failure in 7623bf0b06 by David Carlierext/imap/config.m4
: -Werror=implicit-function-declaration
compatibility in GH-10948 by Michael Orlitzkyext/intl
IntlChar::enumCharNames changes the signature to void in 2da299703a by David CARLIERext/posix
: posix_eaccess little update and forgotten UPGRADING entry. (#10965) in 717f460fa4 by David CARLIERAt 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 or Mastodon phpc.social/@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.