From 4e841cfc67888a6bf08158d891b45b1f57971a3f Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Thu, 11 Dec 2025 14:47:14 +0800 Subject: [PATCH] Update src/Package/Target/php/windows.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Package/Target/php/windows.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Package/Target/php/windows.php b/src/Package/Target/php/windows.php index 28952637..7e22542d 100644 --- a/src/Package/Target/php/windows.php +++ b/src/Package/Target/php/windows.php @@ -181,11 +181,15 @@ trait windows // Fix PHP VS version // get vs version $vc = WindowsUtil::findVisualStudio(); - $vc_matches = match ($vc['major_version']) { - '17' => ['VS17', 'Visual C++ 2022'], - '16' => ['VS16', 'Visual C++ 2019'], - default => ['unknown', 'unknown'], - }; + if ($vc === false) { + $vc_matches = ['unknown', 'unknown']; + } else { + $vc_matches = match ($vc['major_version']) { + '17' => ['VS17', 'Visual C++ 2022'], + '16' => ['VS16', 'Visual C++ 2019'], + default => ['unknown', 'unknown'], + }; + } // patch php-src/win32/build/confutils.js FileSystem::replaceFileStr( "{$package->getSourceDir()}\\win32\\build\\confutils.js",