You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support running z-engine on Windows x64. The runtime resolves FFI definitions by platform key, so the work is generating and validating windows-x64 artifacts and handling the Windows-specific symbol loading.
What's needed
Header generation on Windows.emit.php relies on clang, cpp/clang -E, php-config and a C compiler. On Windows this needs the PHP SDK toolchain (or clang-cl) and the PHP dev pack headers. generate.php's Docker orchestration is Linux-only; a Windows path (native or a Windows CI runner) is required.
Symbol loading. Unlike Linux/macOS (which resolve engine symbols from the running process), Windows needs FFI_LIB pointing at the PHP DLL (historically php7.dll; for PHP 8 it's php8ts.dll/php8.dll depending on the build). The generated header currently only emits FFI_SCOPE; the Windows generator will need to emit the correct FFI_LIB line, and Core will need to select it.
Calling convention.ZEND_FASTCALL maps to __vectorcall on Windows — verify the generated declarations handle this (the current generator strips it via cpp, which may or may not be correct for the ABI).
ZTS. Official Windows PHP builds are commonly thread-safe; this likely needs the ZTS runtime work (separate issue) as a prerequisite.
Acceptance
Generated include/8.4/windows-x64-*/* validated against a real Windows PHP 8.4 build
Symbol resolution via the correct PHP DLL
A Windows CI job runs at least the non-destructive suite
Part of the platform-support roadmap referenced in the README support matrix (see #57).
All three acceptance criteria are now met on both release lines (#180 on 8.4, #182 on master):
Generated artifacts validated against real Windows PHP: include/8.4/windows-x64-{nts,zts} and include/8.5/windows-x64-{nts,zts} are generated on windows-latest runners from the official devel packs and layout-validated by FFI against the C compiler on every run.
Symbol resolution via the PHP DLL: the Windows headers emit FFI_LIB "php8.dll"|"php8ts.dll", Core::init() passes the DLL to FFI::cdef() explicitly, and ZEND_FASTCALL/__vectorcall symbols resolve through FFI's name@@N export mangling — the 2019 blocker from Add Windows platform support #1 is gone in current PHP builds.
Windows CI: tests-windows runs the full suite (not just non-destructive) on both NTS and ZTS, plus header-drift-windows regeneration checks; all green on 8.4 and master.
Both thread-safety modes are covered with no upstream gap (windows.php.net ships x64 NTS+ZTS for 8.4 and 8.5). Intentionally out of scope and tracked in #119: the opcache file-cache relocator on Windows and opcache.preload (which does not exist there).
Activity
fix(core): resolve engine artifacts and the CRT on Windows (#59)
test: make the suite runnable on Windows (#59)
feat(gen): generate windows-x64 artifacts natively (#59)
Generate windows FFI engine definitions for PHP 8.4 (#59)
Generate windows FFI engine definitions for PHP 8.4 (#59)
Merge pull request #180 from lisachenko/claude/z-engine-windows-support
Generate windows FFI engine definitions for PHP 8.5 (#59)
lisachenko commentedon Aug 8, 2026
All three acceptance criteria are now met on both release lines (#180 on
8.4, #182 onmaster):include/8.4/windows-x64-{nts,zts}andinclude/8.5/windows-x64-{nts,zts}are generated onwindows-latestrunners from the official devel packs and layout-validated by FFI against the C compiler on every run.FFI_LIB "php8.dll"|"php8ts.dll",Core::init()passes the DLL toFFI::cdef()explicitly, andZEND_FASTCALL/__vectorcallsymbols resolve through FFI'sname@@Nexport mangling — the 2019 blocker from Add Windows platform support #1 is gone in current PHP builds.tests-windowsruns the full suite (not just non-destructive) on both NTS and ZTS, plusheader-drift-windowsregeneration checks; all green on8.4andmaster.Both thread-safety modes are covered with no upstream gap (windows.php.net ships x64 NTS+ZTS for 8.4 and 8.5). Intentionally out of scope and tracked in #119: the opcache file-cache relocator on Windows and
opcache.preload(which does not exist there).Generated by Claude Code
lisachenko commentedon Aug 9, 2026
Implemented in #180
Generate windows FFI engine definitions for PHP 8.4 (#59)
Generate windows FFI engine definitions for PHP 8.4 (#59)
Generate windows FFI engine definitions for PHP 8.5 (#59)
Generate windows FFI engine definitions for PHP 8.4 (#59)
Generate windows FFI engine definitions for PHP 8.5 (#59)