[GIT-PULLS] [php-src] PR #22783: Fix GH-22782: preloading FCC const exprs

[email protected] (arnaud-lb) Fri, 17 Jul 2026 12:24:27 +0000
Newsgroups php.git-pulls
Message-ID <zTglkav2S6S5VurI53whVGo6bYIBSSBWPs5ZRdTuboc@main.internal.php.net>
Pull Request: https://github.com/php/php-src/pull/22783
Author: arnaud-lb

Fixes GH-22782.

Preloading will try to evaluate class constants during compilation, but evaluated FCCs are objects, which can not be persisted. Apply the same fix as for enums: Fail evaluation when compiling.

Preloading will also reset CG(map_ptr_last) after compilation, which results in collisions if map ptrs were allocated during compilation. Move the ZEND_MAP_PTR_NEW() to the persist phase, as a shared map ptr is not necessary before that.