Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95705 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42022 invoked from network); 6 Sep 2016 21:39:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Sep 2016 21:39:33 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.220.169 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.220.169 mail-qk0-f169.google.com Received: from [209.85.220.169] ([209.85.220.169:33293] helo=mail-qk0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/82-18051-4973FC75 for ; Tue, 06 Sep 2016 17:39:33 -0400 Received: by mail-qk0-f169.google.com with SMTP id z190so232973764qkc.0 for ; Tue, 06 Sep 2016 14:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4A91yJXgnIwDXAKwsdxwYNRkMTVAmfbswR8INAaBS3c=; b=Aaiv4RDf6JbTdP6fu98yXYTNzqSwhcVMpyvlg5CIU0yBmA9sisd/sJ1Rfml1AJzqfZ DaI1qIjs4z3Yn83cHzbVqKZs9/OBaWOGthqIWbZF0Encml+UUBc6W/A4HA6rfS989CXU jRCDk1dvxAPZwO2auTjEgaG9kDw1LSu1cZONymTYEsmNlw+PRBPhBX22bW3RkeuuX0BT lR2cSDJcJlngBXNs0wtT8jvE7A9WnhR13soFMDoanTjHu22TX0zsoIx1KtqgrP+EtJ4T hqh9vaCDd3cREZhdXtc5ha22uQQ5skSjURURzNSBXMZnE0QbkGLEI7XDWhRbhlLPLj/R zNtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4A91yJXgnIwDXAKwsdxwYNRkMTVAmfbswR8INAaBS3c=; b=UpggLJXlRxS5XeUXqbn4BMS8/dloBziIET4b5orjVbO+zkGGLbidMU2XjoDmLYbv3K Uz+kS7Hr1VKKJZZXXR6ry3xSO/ZatYM14Rv7VnJ1ly34ATfimRR7FarMzk9TCHGN6KYw 1ogCiZTHYcaPfwDkA3rso9s+XL01Mh6Gyx7UOJHPEIyt3kRhSpm6mrvAP3WyZNZTuf7j Hi1VQOpnD/2KpZvWQZ7182Lo2V8X+bfgOMOVhV76Tu6Lw5Ki+lWHNVWyajhOahSz+80v unG4mOJVExaB1R8pNmMnLuzk5U6SukM8vnVXYdGS3KuTrkc3UZ1yz5UR4YLV2u7J3+u5 hXLA== X-Gm-Message-State: AE9vXwOx87SGRvc0FStXcsTTQwzJ8TUoDnqvJgeZ9UvAI+QejGHYw7EsvgOhsMvgBmpWhhJjXbD0c9TAxIxYAFFY X-Received: by 10.55.24.134 with SMTP id 6mr25979635qky.138.1473197970218; Tue, 06 Sep 2016 14:39:30 -0700 (PDT) MIME-Version: 1.0 Sender: me@daveyshafik.com Received: by 10.237.50.161 with HTTP; Tue, 6 Sep 2016 14:39:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Sep 2016 14:39:29 -0700 X-Google-Sender-Auth: JEh0TLkAmJDKqqAwTpyYPKf2Ucc Message-ID: To: Dan Ackroyd Cc: Andrea Faulds , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1142e86cb33a91053bdda1ce Subject: Re: [PHP-DEV] Re: [PREVOTE] PHP Engine Constants From: davey@php.net (Davey Shafik) --001a1142e86cb33a91053bdda1ce Content-Type: text/plain; charset=UTF-8 On Tue, Sep 6, 2016 at 1:32 PM, Dan Ackroyd wrote: > On 5 September 2016 at 19:43, Davey Shafik 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 --001a1142e86cb33a91053bdda1ce--