# [RFC] [VOTE] Add PHP Engine Constant Identifier

- Thread: https://externals.io/message/95882
- Original archive: https://news-web.php.net/php.internals/95882
- Started by Davey Shafik on 2016-09-09T23:49:56+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #95882 — Davey Shafik — 2016-09-09T23:49:56+00:00

URL: https://externals.io/message/95882#95882

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

---

## #95884 — Kalle Sommer Nielsen — 2016-09-10T00:42:03+00:00

URL: https://externals.io/message/95882#95884 · In reply to: #95882

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

---

## #95885 — Davey Shafik — 2016-09-10T01:00:04+00:00

URL: https://externals.io/message/95882#95885 · In reply to: #95884

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



> Hi Davey
>
> 2016-09-10 1:49 GMT+02:00 Davey Shafik <davey@php.net>:
> > […]
>
> 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

---

## #95886 — Stanislav Malyshev — 2016-09-10T01:05:59+00:00

URL: https://externals.io/message/95882#95886 · In reply to: #95882

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

---

## #95887 — Davey Shafik — 2016-09-10T01:09:49+00:00

URL: https://externals.io/message/95882#95887 · In reply to: #95886

On Fri, Sep 9, 2016 at 6:05 PM, Stanislav Malyshev <smalyshev@gmail.com>
wrote:

> Hi!
>
> > […]
>
> 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?

---

## #95888 — Kalle Sommer Nielsen — 2016-09-10T01:11:02+00:00

URL: https://externals.io/message/95882#95888 · In reply to: #95887

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

---

## #95889 — Davey Shafik — 2016-09-10T01:12:22+00:00

URL: https://externals.io/message/95882#95889 · In reply to: #95887

> On Fri, Sep 9, 2016 at 6:05 PM, Stanislav Malyshev <smalyshev@gmail.com>
> wrote:
>
> > […]
>
>
> 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.
