Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94346 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4751 invoked from network); 30 Jun 2016 22:46:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2016 22:46:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=mails@thomasbley.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mails@thomasbley.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain thomasbley.de from 85.13.128.151 cause and error) X-PHP-List-Original-Sender: mails@thomasbley.de X-Host-Fingerprint: 85.13.128.151 dd1730.kasserver.com Received: from [85.13.128.151] ([85.13.128.151:40089] helo=dd1730.kasserver.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/58-14264-D31A5775 for ; Thu, 30 Jun 2016 18:46:22 -0400 Received: from dd1730.kasserver.com (dd0802.kasserver.com [85.13.143.1]) by dd1730.kasserver.com (Postfix) with ESMTPSA id A54121A805EF; Fri, 1 Jul 2016 00:46:18 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SenderIP: 92.211.161.133 User-Agent: ALL-INKL Webmail 2.11 In-Reply-To: References: <20160620222835.BC26C1A80609@dd1730.kasserver.com> <14352177-1b49-e2ed-56a3-9a770d0ebf95@gmail.com> <20160630195252.970321A806C6@dd1730.kasserver.com> To: rasmus@mindplay.dk Cc: smalyshev@gmail.com, michael.vostrikov@gmail.com, internals@lists.php.net, rowan.collins@gmail.com Message-ID: <20160630224618.A54121A805EF@dd1730.kasserver.com> Date: Fri, 1 Jul 2016 00:46:18 +0200 (CEST) Subject: Re: [PHP-DEV] New escaped output operator From: mails@thomasbley.de ("Thomas Bley") > What for? is easy to verify is not easy to verify Regards Rasmus Schultz wrote on 30.06.2016 22:27: > I wish you'd think about the bigger issue of autoloading functions, > which would solve this and many similar problems much more generally. > > I mean, this: > > > > versus this: > > > > What for? > > I don't see the point in inventing new syntax, and introducing a new > concept, for what is effectively just a limited set of certain > specific functions. > > We have functions already - rather than adding new features, we should > improve the features we already have instead, which benefits the > language as a whole, not just templates. Improving on functions is > long over due... > > > On Thu, Jun 30, 2016 at 9:52 PM, Thomas Bley wrote: >> I would prefer to have ENT_HTML5 as the default flag included, since normally >> all new html code is html5. >> Maybe split voting between > > >> Regards >> Thomas >> >> Михаил Востриков wrote on 30.06.2016 21:35: >> >>> I've tried to gather all arguments for and against. >>> >>> To be clear. I suggest new operator like '' which is >>> equivalent of . >>> It is only for HTML context. Flag combination is taken from most popular >>> frameworks - Symfony, Zend, Yii, and Twig. Of course, exact form of >>> operator and default flags are the details of implementation. >>> >>> >>> >>> - You can write short function in userland. >>> >>> The problem is not that we have no function. The problem is that the same >>> action is always repeated, and if we don't repeat it then it leads to >>> security problems. More than 90% of output data - is data from DB and must >>> be HTML-encoded. >>> >>> There is no such problem with other contexts. If we don't call json_encode >>> when passing an array or object into javascript, this only breaks the >>> script, and it will be noticeable, there won't be security problems. >>> >>> With new operator we can write or , or , they are mutually >>> exclusive, and we need specially write one or another, but with helper >>> function we have the same beginning >> or not. >>> >>> Also there is a problem with function autoloading. >>> >>> >>> >>> - It is no place for such operators in the language. >>> It is no place for a such operators in C++, or C#, or Java. But in the most >>> popular language for web-programming it is very place for such operator. >>> >>> >>> >>> - There are many other contexts >>> >>> HTML is external context, but others are internal task-dependent contexts. >>> HTML can be used together with other contexts. >>> HTML context is the main context in every PHP file, and we write >> the beginning to switch it. >>> >>> Actually, on web page we have 3 external contexts - HTML, >script> tag, >>>