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
F3775112: D25801.1745859650.diff
Sun, Apr 27, 17:00
F3720354: D25801.1745710662.diff
Fri, Apr 25, 23:37
F3711540: D25801.1745658686.diff
Fri, Apr 25, 09:11
F3686275: D25801.1745574830.diff
Thu, Apr 24, 09:53
F3605357: D25801.1745265734.diff
Sun, Apr 20, 20:02
F3553375: D25801.1744930631.diff
Wed, Apr 16, 22:57
F3553153: D25801.1744921624.diff
Wed, Apr 16, 20:27
F3503564: D25801.1744798249.diff
Tue, Apr 15, 10:10

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