Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91066 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32833 invoked from network); 3 Feb 2016 17:17:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2016 17:17:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=kinncj@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kinncj@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.54 as permitted sender) X-PHP-List-Original-Sender: kinncj@gmail.com X-Host-Fingerprint: 209.85.213.54 mail-vk0-f54.google.com Received: from [209.85.213.54] ([209.85.213.54:32882] helo=mail-vk0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/F3-33888-13632B65 for ; Wed, 03 Feb 2016 12:17:38 -0500 Received: by mail-vk0-f54.google.com with SMTP id e64so19213665vkg.0 for ; Wed, 03 Feb 2016 09:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=88NGmf38r8VwZ5bBy+Pd7z7/4b2DpyOPJ5/ox1F/6G4=; b=NGZLwiAdjYoj/+uPUkkuXMpB5I4G6BiWfUy/9K7CE4PNiK0KIwTnOyHLDP02PW3iNM M4rIQRMgwAWi964mK7eetBrILaSHSnB/0G3q8BYMKLFXLs8vB/v1tFodxZ4opT3APw39 MY2VKjlx4Ekkly35ro4qIu0zfr2oiwGGJXokw1uo1c2iKq/fRXBrEe5eiv36/NplllNE dtbosIeDnyhV3GL3PcXuL7h+xbf12xb6AqIndHlmLw8MbiJbthqBSjfWaYbPkLiPBjn4 XpwSOHgzsALFY0vmVRqDK3CRzGXfM9M6MUIx8rUX8u6+WvrEy0wLJ2afuBAYSU+idexy yw9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=88NGmf38r8VwZ5bBy+Pd7z7/4b2DpyOPJ5/ox1F/6G4=; b=Nlh+o+CoVNNWG3Az5wcJVNDXxGkWNJE6CPvSmSpDa6+uP/QjVKzHrpZApRQ3L/nT/H NZ4/napTxjBCAdajB4rCbJBqeiGyG5RCiE+3NTYbXyPoxPlRus/HMaQ25shD7WYv/14M +RdIvHldZbkWPo4WJkmdIrSe5ChScrDmTwJQgFfAo8VHzDSf5xpdeTBlrB0MzX5vGid+ 1d0rQlVG9YzOxQjJRDKDcLW9dPoGLNqUOYAVKANiW0xADwnNTKvPPs/wJRXkJkoKbD1s u3hqpPBw2o3DM/W8U7fOn4zvnllL2SVg6HisAli/ZbkBxxhLCkj4KSiTFpUlqrrauQVb aVwQ== X-Gm-Message-State: AG10YOT04gyNjldeFePAlOcZC6m73vTm8agBmNYY00zGyKX5AjlmlRPBOFCY/7O0Z0ZX9ktdPyyK4fjpf43VTw== X-Received: by 10.31.180.85 with SMTP id d82mr1760100vkf.83.1454519854825; Wed, 03 Feb 2016 09:17:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.52.23 with HTTP; Wed, 3 Feb 2016 09:17:15 -0800 (PST) In-Reply-To: <56B233C0.10301@mprelu.de> References: <56B233C0.10301@mprelu.de> Date: Wed, 3 Feb 2016 12:17:15 -0500 Message-ID: To: Matt Prelude Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a114382ce440b14052ae0cb4e Subject: Re: [PHP-DEV] [RFC] Add PHP_ENGINE Constant From: kinncj@gmail.com (=?UTF-8?B?S2lubiBKdWxpw6Nv?=) --001a114382ce440b14052ae0cb4e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Feb 3, 2016 at 12:07 PM, Matt Prelude wrote: > 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 =3D=3D=3D PHP a.b > (feature-wise). > > I can see how this could be useful. Would get my +1 if I had a vote. > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I agree with Andreas when: And in the end the goal would be to not adapt the code to different > runtine-engines but to adapt the runtime engines to run the code in the > same manner. That's what the language-specification is there for. If the motivation is: > I want to bring forward a very simple RFC to help solve an issue I had th= is > week of writing unit tests that take into account differing behaviors in > PHP and HHVM. I suggest the following http://hhvm.com/blog/2393/hhvm-2-3-0-and-travis-ci and instead of introducing one more constant, you could easily use *if (defined('HHVM_VERSION')) {}* --=20 *--* *Kinn Coelho Juli=C3=A3o* *Toronto - ON/Canada* --001a114382ce440b14052ae0cb4e--