[php-src] PR #25592: ext/spl: Resolve constants before instantiating a stored class

From: Date: Thu, 19 Nov 2026 15:24:29 +0000
Subject: [php-src] PR #25592: ext/spl: Resolve constants before instantiating a stored class
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-40813@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/25592 Author: iliaal ArrayObject::getIterator(), SplFileInfo::openFile(), getFileInfo(), getPathInfo() and FilesystemIterator with CURRENT_AS_FILEINFO skip the constant resolution that new does, so a user class with constants in its property defaults gets the unevaluated expression, and under opcache object_properties_init() dereferences NULL. Resolve the class constants first; object_init_ex() would also start rejecting abstract classes. This targets PHP-8.4 because ordinary code hits it: a subclass with public $x = SOME_CONST; as the iterator or info class. Fixes GH-25585

« previous php.git-pulls (#40813) next »