Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27321 invoked from network); 3 Feb 2016 17:07:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2016 17:07:22 -0000 Authentication-Results: pb1.pair.com header.from=me@mprelu.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@mprelu.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mprelu.de from 74.201.84.163 cause and error) X-PHP-List-Original-Sender: me@mprelu.de X-Host-Fingerprint: 74.201.84.163 sender163-mail.zoho.com Received: from [74.201.84.163] ([74.201.84.163:25149] helo=sender163-mail.zoho.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/B2-33888-7C332B65 for ; Wed, 03 Feb 2016 12:07:21 -0500 Received: from [192.168.0.5] (bcdfe029.skybroadband.com [188.223.224.41]) by mx.zohomail.com with SMTPS id 145451923436668.72164662407431; Wed, 3 Feb 2016 09:07:14 -0800 (PST) To: internals@lists.php.net References: Message-ID: <56B233C0.10301@mprelu.de> Date: Wed, 3 Feb 2016 17:07:12 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Zoho-Virus-Status: 1 Subject: Re: [PHP-DEV] [RFC] Add PHP_ENGINE Constant From: me@mprelu.de (Matt Prelude) Hi, On 03/02/16 16:54, Dan Ackroyd wrote: > On 3 February 2016 at 09:03, Davey Shafik wrote: >> Hi all, >> >> It's actually very difficult to be able to reliably determine that you are >> running the _real_ PHP runtime and not something mimicking it. > The underlying problem seems to be caused by HHVM deliberately > 'faking' the results of calls to zend_version() and the existing > constants. What is there to stop any other PHP implementations from > returning 'fake' data for that function or these new constants? > > And just to play devils advocate, why isn't this a problem that should > be solved in those other versions of PHP? They're the ones re-using > version strings and so causing confusion. > > I can see how this could be useful....I just can't see how this would > be a permanent solution to the problem. As someone else said, this > sounds like the old detecting browsers via "user agent headers" for > browser detection. That became a complete nightmare as browsers kept > imitating each other, and so the rules about strings became less and > less useful. > > Perhaps it might be helpful to justify the RFC, if you can give some > more context as to why code needs to know about what VM it is running > on? > > cheers > Dan > I think Dan raises some interesting points, although I think zend_version() is often used for feature detection so they try to put a zend version in there to be helpful i.e. HHVM x.y.z === PHP a.b (feature-wise). I can see how this could be useful. Would get my +1 if I had a vote.