Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104945 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8736 invoked from network); 25 Mar 2019 21:09:10 -0000 Received: from unknown (HELO mail-vs1-f52.google.com) (209.85.217.52) by pb1.pair.com with SMTP; 25 Mar 2019 21:09:10 -0000 Received: by mail-vs1-f52.google.com with SMTP id w13so5965134vsc.4 for ; Mon, 25 Mar 2019 11:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pylDogAKaAkPHbErOP98otijWfZ2n5TcfbrcNKQCvHY=; b=To/ROAp0V4Vpya1dgXKmbKoyzFTjXcyQJ1pno6akpKs/DKP3Eee1bh/Azb9UiSA4qK CpN29YdIHaMYg7HVkbCBRSNClVDP2NkUL2J3syte33SJHaiprYpb22NcwmOQMDHqaW/F 75wiSqCKHI4qjduJ5/65s1zfmoBq+odYZyf0oC85xNjm/Goy9I05P2wdMr65Yn7ovo6m yl258LqBCtgks0aoDflyKUlVlhApOAkjKpIUCFLpQ6vIt3Guj12APOLkjvTFOum0jXbl pUt64tEfgn7b0c5CF76xdEWCyDvlImdLj/T5us4w65OfZKxLl+2MaRkhsJt6D/eqDZ+S 33GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pylDogAKaAkPHbErOP98otijWfZ2n5TcfbrcNKQCvHY=; b=pHkQ0kl95zZYKrTZPLGoK57IaobPtejfKg1zTADtsKSJeTC3hQqg4iRclWviaTykd3 sKtZNWFRPsNsG6HL7OxZY9FpgMJZOKql71ZLtNwI/hHwRxgi6GvCmr//kLIfhTw9NNjJ fIamRrHyFXBODr3/lBgDRPZ0LTECXfEe141dKH9RBLLkmXy7HToOQA6VfvtgwKlocC72 xa8+M5jP4Q86cxdeXNbScWD6M58AwabuO6YZpWL4E7GbJFToBuL3uwGOT5E89FWewKXZ gpxKueisaeq5XbQZ1qHdbucTb0geqP5+Pc0zV2t7g3p0wVQVRp66VGJavanGZYjE//QE fZQw== X-Gm-Message-State: APjAAAWBwx9TFyW+3KKWUtEB+oajCC7qeM+qudg9Q70NoAJnosrmRKiQ KBaV/2cKub2qpw1Rss2FCg8BFbSBRHE9V0zVFrk= X-Google-Smtp-Source: APXvYqwwgksn0eVdu4NkpP9LYXv8sJy6dlB2h39e9yw9r+inGPOrm8ScFATIdeDg/fdI4uDiMGGMexo3xWCbCvm1Wks= X-Received: by 2002:a67:f30f:: with SMTP id p15mr15483511vsf.158.1553536941097; Mon, 25 Mar 2019 11:02:21 -0700 (PDT) MIME-Version: 1.0 References: <000301d4e312$06a88190$13f984b0$@roze.lv> In-Reply-To: <000301d4e312$06a88190$13f984b0$@roze.lv> Date: Mon, 25 Mar 2019 19:02:09 +0100 Message-ID: To: Reinis Rozitis , Rasmus Schultz , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , narf@devilix.net Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000008505920584ef01ce" Subject: Re: [PHP-DEV] [RFC] Deprecate PHP's short open tags From: george.banyard@gmail.com ("G. P. B.") --0000000000008505920584ef01ce Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Seems like the discussion is split between this thread and the previous one= . This is maybe due to me not linking the RFC announcement email in the RFC immediately and I apologize for this inconvenience. I will try to answer to most things within the announcement thread. If I missed someone could they please notify me. On Mon, 25 Mar 2019 at 14:52, Reinis Rozitis wrote: > Hi, > I did read the initial thread about this and now the RFC and it doesn't > really state what is the reason of removing the short tags besides this o= ne > line: > "PHP has provided over the years different ways to indicate the beginning > of PHP code other than the standard " > > Is there a (noticeable) speed improvement or does it make the > parser/engine more simple? Is it wrong to provide different ways to > indicate the start of php code? > Since the short ' You could argue that ' Also considering there is somewhat low adoption of new php versions [1] a > change which brakes a lot of legacy code might even further push back the > switch to modern/current versions (at least now even if the defaults > disable the short tags, there is an option to reenable the functionality)= . > Obviously you could say that those using old versions won't be affected > anyways and those using php 7.x and waiting for 8.x will use recent > application code and also won't notice this deprecation, but in my opinio= n > (and praxes) it isn't always the case. > > [1] https://w3techs.com/technologies/details/pl-php/all/all > > rr > Just as a reminder exposing PHP's version can be disabled with the "expose_php" INI setting. Maybe this is just me idealising stuff but as there is automatics tooling (as pointed out by C=C3=B4me Chilliet) I would suppose that upgrading from PHP 7 to PHP 8 wouldn't be harder if PHP's short open tags get removed. On Mon, 25 Mar 2019 at 16:38, Andrey Andreev wrote: > OK, so why not flip it and make it always available instead? I'm aware > of the potential XML conflict, but I've personally never seen it, so > to me that looks like the lesser evil compared to a massive BC break. > > Cheers, > Andrey. Technically this is already the case, the default in the engine is to enable PHP's short open tags, however both INI config templates provided with PHP (php.ini-developement and php.ini-production) disable PHP's short open tags. So if PHP's short open tags are to be considered "full class" open tags this should be represented in the INI templates. But I won't be the one pushing for this change. On Mon, 25 Mar 2019 at 16:16, Johannes Schl=C3=BCter wrote: > On Mo, 2019-03-25 at 09:38 -0500, Sara Golemon wrote: > > > > As we stand now, code using short open tags works when those tags are > > enabled. As we'd stand in the future, that code would not work. > > That > > level of BC break requires a strong justification. > > The code would not simply "not work" but even potentially leak to the > client (as PHP would not treat it as code) which could leak credentials > or other sensitive information. > I think this can be an interesting point to add to the RFC as why to deprecate the short open tags. I still think that long-term goal should be that language behavior > doesn't depend on ini configuration. > > [...] > > johannes > This is mostly my reasonning on why bringing this RFC to the table. On Mon, 25 Mar 2019 at 17:21, Rasmus Schultz wrote: > For the record, we're a mid-size organization, building a modern product = on > PHP 7 with a PSR-based stack. > > We've shunned template engines and rely heavily on short open tags and > alternative control-structures - mainly because we insist on static > analysis and IDE support, which we get by manually type-hinting a single > view-model variable $view at the beginning of each template. > > No other template engine gives us what we want in terms of static analysi= s, > type-checking or IDE support. > > The choice to rebuild a very large product in PHP vs e.g. Node, at the > time, was in part motivated by PHP's template features - which, while it > may look pretty verbose and ugly on the surface, has a huge advantage ove= r > basically anything else, e.g. static analysis with various QA tools, > automated refactorings (rename etc.) in PHP Storm, and so on. > > The loss of this feature would be a substantial setback for our > organization - for which there is no really good replacement. This is an interesting use case, however may I ask why using '