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
F3294988: D25801.1742948628.diff
Tue, Mar 25, 00:23
F3292811: D25801.1742901235.diff
Mon, Mar 24, 11:13
F3280737: D25801.1742658289.diff
Fri, Mar 21, 15:44
F3254916: D25801.1742488088.diff
Wed, Mar 19, 16:28
F3216138: D25801.1741680399.diff
Mon, Mar 10, 08:06
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

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