Page MenuHomePhorge

Fix PHP 8.1 "preg_match(null)" exception in XHPASTNode
ClosedPublic

Authored by aklapper on Aug 23 2024, 11:14.
Tags
None
Referenced Files
F3033439: D25801.1740882904.diff
Sat, Mar 1, 02:35
F3001549: D25801.1740443464.diff
Mon, Feb 24, 00:31
F3001548: D25801.1740443462.diff
Mon, Feb 24, 00:31
F2994680: D25801.1740324908.diff
Sat, Feb 22, 15:35
F2992586: D25801.1740230575.diff
Fri, Feb 21, 13:22
F2951148: D25801.1738874053.diff
Wed, Feb 5, 20:34
F2940277: D25801.1738048510.diff
Jan 27 2025, 07:15
F2938956: D25801.1738026826.diff
Jan 27 2025, 01:13

Details

Summary

When $u is null, null is passed to preg_match() which is deprecated behavior since PHP 8.1.
Thus first check if $u === null.

ERROR 8192: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [/var/www/html/phorge/arcanist/src/parser/xhpast/api/XHPASTNode.php:243]

Refs T15926

Test Plan

Either read the code, or probably run something like arc unit on D25797?

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable