On Tue, Sep 6, 2016 at 1:32 PM, Dan Ackroyd <dan...@basereality.com> wrote:

> On 5 September 2016 at 19:43, Davey Shafik <da...@php.net> wrote:
> >
> > Instead, it would be better to check PHP_ENGINE ===
> > 'hhvm' && PHP_ENGINE_VERSION_ID <= 30813
>
> And then when the next people who want to build an alternative engine
> come along, they will include this constant, to make their engine as
> 'compatible' as possible with the current PHP engine.
>
> i.e. adding this doesn't provide a way of telling real PHP apart from
> something that is copying it.
>

The key to this is that it's part of the spec. If you actually want to
follow the spec, you have to implement it this way. If you don't, then
you're a bad person. :P


> > Then you need to check for HHVM_VERSION
>
> So...that sounds like the correct thing to be checking for. Test for
> known "almost but not quite PHP" engines, otherwise assume that you're
> running on real PHP.
>

The problem is also when running on unknown PHP engines. Assumptions are
terrible things.

- Davey

Reply via email to