Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95545 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40011 invoked from network); 1 Sep 2016 21:12:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2016 21:12:42 -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.173 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.220.173 mail-qk0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:33759] helo=mail-qk0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/B6-47600-8C998C75 for ; Thu, 01 Sep 2016 17:12:41 -0400 Received: by mail-qk0-f173.google.com with SMTP id z190so99274506qkc.0 for ; Thu, 01 Sep 2016 14:12:40 -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; bh=2KHwGMwxvtk+2mPAvbU2k6DzUFdiNHtgYr3fUDdKBdM=; b=aLmt4hLIUow1bzEVkU4XNRH4woGD/aAU4Fhq5M3qu6GIy7bpYYyaBLpyBsq0fIf0nP phocr3Xvwgy/dEAbDnZG/MOcan8apz1yF1notEgAKVRuGXTLnqTeU626A1HOkp64wy+N snIKHkCUuMSe2hmV7nzF5IAf3YS1+igLwl4xdFkqlOdPNv7q9DtUUlVRqsRLTmUtSBsG TKzwBrrpWNAiMQ5/6XoX6m+mxKNLJXjPGTlBoGiXdPT//iFH8lfmZ5iRytsPuuVIycAp LEK6cFTCYfbBRrIg3gMjIJ0+NmrDeRDjieYKu7+1532te5wa3wAd3eYjeqrEEqPpqjrO NW1Q== 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; bh=2KHwGMwxvtk+2mPAvbU2k6DzUFdiNHtgYr3fUDdKBdM=; b=BoYFiHCpZhSzdAFW2t/YP58bSLm8F5OoUiJ5u4tWKIGc3ynfCk4iWOMdQ1rVlrnnLA 932BEyG8JWFto5mcBtYR/3iGGTNOEOo4TMCXOTMB4IjXHbxpoOwxYOYoTNqxSjC/pJRE 4ZANZ5culp7hROokluu9Yr9am3EJb+18T7ZvZRPwz4DpD/gaeN9/mAn5v1XqHlZ07LE9 7vRQoLVNJMxh4a9EhLXkCXty6uPbBElIW5IlqRv9CQkV2aMzKjdgHoCePZN465WkdIP6 pFjcMxbnPCry1LfavKrDpIBO0CxF6EmRRPEj7wZp/CX+kEefuku7Jfb1H7xO1OvzWkmJ eGKw== X-Gm-Message-State: AE9vXwNQEZSPHejeMQYPVYSF4zM3eg2fcdlh/b3rT5RrQvUyzaoJO5pXp1TLA87osyyPOB1ZmXykoUhkW0MmzC/p X-Received: by 10.233.237.137 with SMTP id c131mr19337222qkg.152.1472764357777; Thu, 01 Sep 2016 14:12:37 -0700 (PDT) MIME-Version: 1.0 Sender: me@daveyshafik.com Received: by 10.237.55.138 with HTTP; Thu, 1 Sep 2016 14:12:37 -0700 (PDT) In-Reply-To: <483bc944-22eb-7256-2687-e9607ffcba6c@fleshgrinder.com> References: <483bc944-22eb-7256-2687-e9607ffcba6c@fleshgrinder.com> Date: Thu, 1 Sep 2016 14:12:37 -0700 X-Google-Sender-Auth: Pv6m6h5b4EJIXk6oELxGGCGimow Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c0983d462358e053b78ac63 Subject: Re: [PHP-DEV] [PREVOTE] PHP Engine Constants From: davey@php.net (Davey Shafik) --94eb2c0983d462358e053b78ac63 Content-Type: text/plain; charset=UTF-8 On Thu, Sep 1, 2016 at 12:04 PM, Fleshgrinder wrote: > On 9/1/2016 8:02 PM, Davey Shafik wrote: > > Hey all, > > > > A while back I brought a small RFC to internals, that proposed a set of > > constants that were specifically for alternative implementations to > > identify themselves as such if they want to conform to the spec. > > > > https://wiki.php.net/rfc/php_engine_constant > > > > There were some folks who didn't like it, but nobody suggested different > > implementations, just didn't feel it was necessary. As such, I'm > planning to > > bring it to a vote next week - this is simply a heads up as it's been a > > while > > and I want to give a chance for any objections other than not wanting it > to > > be voiced before I open it up for voting. > > > > The vote will be a straight 50%+1 yes/no vote. > > > > - Davey > > > > +1 from my side. > > What do you think about including a platform and architecture identifier > too? > > const string PHP_ENGINE_PLATFORM = ''; > > WINDOWS > LINUX > MACOS > CYGWIN > FREEBSD > SOLARIS > ... > > This would solve all the tricks we see in various code bases that try to > determine what platform the current PHP installation is running on, > e.g.: if (DIRECTORY_SEPARATOR === '\\') could be replaced with a more > readable if (PHP_ENGINE_PLATFORM === 'WINDOWS'). > > const string PHP_ENGINE_ARCHITECTURE = ''; > > x86 > x64 > ia64 > arm > ... > > This is not required as often but still needed at some places. This > would allow to replace checks like if (PHP_INT_SIZE === 8) with if > (PHP_ENGINE_ARCHITECTURE === 'x64'). We already have PHP_OS, and architecture is likely too broad to determine specific things like INT size etc. That is, while you may be using things like INT size to determine architecture, the inverse is not necessarily true. I don't think these really fit in with the goal of this RFC, which is more about identifying the spec being implemented in alternative runtimes; while your suggestions would just be part of the spec and would just be in those runtimes like any other feature. - Davey --94eb2c0983d462358e053b78ac63--