Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26640 invoked from network); 3 Feb 2016 17:06:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2016 17:06:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=andreas@heigl.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andreas@heigl.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain heigl.org from 195.191.240.18 cause and error) X-PHP-List-Original-Sender: andreas@heigl.org X-Host-Fingerprint: 195.191.240.18 hos109.unaxus.net Received: from [195.191.240.18] ([195.191.240.18:46638] helo=hos109.unaxus.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/92-33888-8A332B65 for ; Wed, 03 Feb 2016 12:06:50 -0500 Received: from heigl.gw.tgnet.de ([80.72.250.242]:57325 helo=wdv-hg-0C07-zX4090-HeiglAndreas.local) by hos109.unaxus.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86) (envelope-from ) id 1aR0t9-0041ex-KK; Wed, 03 Feb 2016 18:06:43 +0100 To: Dan Ackroyd , Davey Shafik References: Cc: "internals@lists.php.net" , Sara Golemon X-Enigmail-Draft-Status: N1110 Message-ID: <56B233A2.8010900@heigl.org> Date: Wed, 3 Feb 2016 18:06:42 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms000507000109090008060506" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hos109.unaxus.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heigl.org X-Get-Message-Sender-Via: hos109.unaxus.net: authenticated_id: a.heigl+heigl.org/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hos109.unaxus.net: a.heigl@heigl.org Subject: Re: [PHP-DEV] [RFC] Add PHP_ENGINE Constant From: andreas@heigl.org (Andreas Heigl) --------------ms000507000109090008060506 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 03.02.16 um 17:54 schrieb Dan Ackroyd: > 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. >=20 > 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? >=20 > 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. >=20 > 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. >=20 > 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? Especially when running tests on f.i. Travis-CI you can set an environment variable to describe what environment you are supposed to be in. In all other cases feature-detection (function_exists/extension_loaded f.i.) should work fine to determine whether the used engine is able to run a certain function. 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. My 2 Cent Cheers Andreas >=20 > cheers > Dan >=20 --=20 ,,, (o o) +---------------------------------------------------------ooO-(_)-Ooo-+ | Andreas Heigl | | mailto:andreas@heigl.org N 50=C2=B022'59.5" E 08=C2=B0= 23'58" | | http://andreas.heigl.org http://hei.gl/wiFKy7 | +---------------------------------------------------------------------+ | http://hei.gl/root-ca | +---------------------------------------------------------------------+ --------------ms000507000109090008060506 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSI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