On 01.08.2024 at 23:57, Ilija Tovilo wrote:

> […] The biggest blocker in the past was MSVC, which has finally
> added C11 support in Visual Studio 2019 [8]. Technically, Visual
> Studio 2015 and 2017 are still supported by Microsoft [9], but
> according to Christoph they are no longer used for PHP builds since
> version 8.

Right.  As of PHP 8.0.0, VS16 (aka. Visual Studio 2019) is used for the
builds, and as of PHP 8.4.0, VS17 (aka. Visual Studio 2022) is supposed
to be used.  Of course, users may still use an older Visual Studio
version, and want to be able to still build latest PHP, but they still
can install a newer Visual Studio version in parallel (and at least,
using only the Buildtools for Visual Studio 2022, shouldn't be a concern
regarding the license, because they are free to use to build Open-Source
software, and should be totally sufficient to build PHP and extensions).
 There might be a slight glitch, namely that a few users want to include
some PHP modules into their software (e.g. the embed SAPI); that might
cause issues, but on the other hand, nobody should expect to work some
latest Open-Source software version to work flawlessly with older
versions of other software.  So these users (if there are any) could
still work with PHP 8.3, for instance, until they upgrade to Visual
Studio 2022.

> Hence, it seems like it would be ok to bump our C compiler requirement
> to C11. We'd like to make this change before beta 1 if there are no
> objections. There are no immediate plans to make non-optional use of
> other C11 features, although that is conceivable at some point.

I'm all for it, given the alternatives would be worse, and presuming
there is no real show-stopper.

> Another benefit brought up by Christoph is that C11 relegated the
> requirement for the compiler to support VLAs (variable-length arrays)
> which was never implemented by MSVC, technically not complying with
> the currently required standard.

Indeed, that caused a couple of issues in the past, not only for
php-src, but also for extensions.  Requiring C11 support might help
developers to detect that early, and choose an alternative
implementation right away.

> [8] 
> https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/
> [9] https://learn.microsoft.com/en-us/visualstudio/productinfo/vs-servicing

Cheers,
Christoph

Reply via email to