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
F2940277: D25801.1738048510.diff
Mon, Jan 27, 07:15
F2938956: D25801.1738026826.diff
Mon, Jan 27, 01:13
F2938954: D25801.1738026825.diff
Mon, Jan 27, 01:13
F2938850: D25801.1738024793.diff
Mon, Jan 27, 00:39
F2932349: D25801.1737733248.diff
Thu, Jan 23, 15:40
F2917095: D25801.1737501957.diff
Mon, Jan 20, 23:25
F2914727: D25801.1737444486.diff
Mon, Jan 20, 07:28
F2914190: D25801.1737437812.diff
Mon, Jan 20, 05:36

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