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
F2899446: D25801.1737262113.diff
Sat, Jan 18, 04:48
F2899445: D25801.1737262070.diff
Sat, Jan 18, 04:47
F2899357: D25801.1737261600.diff
Sat, Jan 18, 04:40
F2893203: D25801.1737223418.diff
Fri, Jan 17, 18:03
F2871133: D25801.1736838266.diff
Mon, Jan 13, 07:04
F2869468: D25801.1736707031.diff
Sat, Jan 11, 18:37
F2869418: D25801.1736704532.diff
Sat, Jan 11, 17:55
F2869417: D25801.1736704524.diff
Sat, Jan 11, 17:55

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