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
F3503564: D25801.1744798249.diff
Tue, Apr 15, 10:10
F3458923: D25801.1744736829.diff
Mon, Apr 14, 17:07
F3387736: D25801.1744440476.diff
Fri, Apr 11, 06:47
F3377244: D25801.1744337345.diff
Thu, Apr 10, 02:09
F3372295: D25801.1744249390.diff
Wed, Apr 9, 01:43
F3372161: D25801.1744248777.diff
Wed, Apr 9, 01:32
F3371965: D25801.1744247175.diff
Wed, Apr 9, 01:06
F3348175: D25801.1743734194.diff
Thu, Apr 3, 02: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