[RFC] [VOTE] Add PHP Engine Constant Identifier

php.internals

Davey

9 years ago
Hi all, As noted last week, I'm now opening up the vote for adding a PHP Engine Identifier constant to PHP 7.2+ (and more importantly, to the language spec). Additionally, there is a second vote to add corresponding PHP_ENGINE_(*_)VERSION(_ID) constants. https://wiki.php.net/rfc/php_engine_constant Thanks, - Davey

Kalle Sommer Nielsen

9 years ago
Hi Davey 2016-09-10 1:49 GMT+02:00 Davey Shafik <davey@php.net>:
> Hi all, > > As noted last week, I'm now opening up the vote for adding a PHP Engine > Identifier constant to PHP 7.2+ (and more importantly, to the language > spec). Additionally, there is a second vote to add corresponding > PHP_ENGINE_(*_)VERSION(_ID) constants.
While I understand the reasoning behind it, I do not think that it is our problem to solve, whether we do if(defined('HHVM_VERSION')) or if(PHP_ENGINE == 'hhvm') seems irrelevant to me. If code are not compliant with the spec, then it should be that implementors responsibility to make sure that it is resolved imho. I do not have anything against HHVM or alternative implementations of PHP, it rocks, but I think we need to look in other directions, as it shouldn't be needed at all to check for what runs your PHP, it should _just_ work. For syntax incompatibility, then we can't even filter out other implementations with a constant thats executed at runtime either, not that I believe it is a major issue, but it is something to consider too. Hence my -1
-- regards, Kalle Sommer Nielsen kalle@php.net

Davey

9 years ago
Kalle, My use case is for the php7-mysql-shim, some of the error messages I duplicate and therefore have tests for, are different on HHVM, meaning the tests fail. The messages aren't in the spec, so they're not failing to support the spec, and it's unlikely to affect functionality — which is why I simply skip the tests on HHVM. This detection is much harder in Hippy, and who knows what other existing and future engines. Also, what happens when we get engines that are good candidates for say, multithreading, and we want to change application behavior on that engine automatically. There are tons of places this _may_ be useful, and there's zero impact to adding it. - Davey On Fri, Sep 9, 2016 at 5:42 PM, Kalle Sommer Nielsen <kalle@php.net> wrote:

Stas Malyshev

9 years ago
Hi!
> As noted last week, I'm now opening up the vote for adding a PHP Engine > Identifier constant to PHP 7.2+ (and more importantly, to the language > spec). Additionally, there is a second vote to add corresponding > PHP_ENGINE_(*_)VERSION(_ID) constants. > > https://wiki.php.net/rfc/php_engine_constant
Somehow, you made it possible to vote both yes and no at the same time :)
-- Stas Malyshev smalyshev@gmail.com

Davey

9 years ago
On Fri, Sep 9, 2016 at 6:05 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote:
> Hi! > > > As noted last week, I'm now opening up the vote for adding a PHP Engine > > Identifier constant to PHP 7.2+ (and more importantly, to the language > > spec). Additionally, there is a second vote to add corresponding > > PHP_ENGINE_(*_)VERSION(_ID) constants. > > > > https://wiki.php.net/rfc/php_engine_constant > > Somehow, you made it possible to vote both yes and no at the same time :)
Uh… wow. Lemme see if I can fix that without breaking the votes. Also, you only voted on the second vote. Was that intentional?

Kalle Sommer Nielsen

9 years ago
2016-09-10 3:09 GMT+02:00 Davey Shafik <davey@php.net>:
> Uh… wow. Lemme see if I can fix that without breaking the votes. > > Also, you only voted on the second vote. Was that intentional?
Fixed it, voteType should be "single", not "multi" :)
-- regards, Kalle Sommer Nielsen kalle@php.net

Davey

9 years ago
On Fri, Sep 9, 2016 at 6:09 PM, Davey Shafik <davey@php.net> wrote:
> On Fri, Sep 9, 2016 at 6:05 PM, Stanislav Malyshev <smalyshev@gmail.com> > wrote: > >> Hi! >> >> > As noted last week, I'm now opening up the vote for adding a PHP Engine >> > Identifier constant to PHP 7.2+ (and more importantly, to the language >> > spec). Additionally, there is a second vote to add corresponding >> > PHP_ENGINE_(*_)VERSION(_ID) constants. >> > >> > https://wiki.php.net/rfc/php_engine_constant >> >> Somehow, you made it possible to vote both yes and no at the same time :) > > > Uh… wow. Lemme see if I can fix that without breaking the votes. > > Also, you only voted on the second vote. Was that intentional? >
Fixed, no voting was lost/changed.