Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95106 invoked from network); 30 Jun 2016 20:27:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2016 20:27:10 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.213.52 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.213.52 mail-vk0-f52.google.com Received: from [209.85.213.52] ([209.85.213.52:35082] helo=mail-vk0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/B6-14264-C9085775 for ; Thu, 30 Jun 2016 16:27:08 -0400 Received: by mail-vk0-f52.google.com with SMTP id u68so83636771vkf.2 for ; Thu, 30 Jun 2016 13:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ebWGN5Y5JWQXtPnReY9dPz7FYYq7h97okegjpfiP7Zg=; b=hhevvfEXP75uV+XdZvau/TKgs9Q9NsrXlLZRccmXPgdwFrvbPrLUqgvCOOWFmKXRNr 9IwMcpnXtO77ESq79ozD/sDzwI36t/sgoboJoou7YPCCqZyOz9h1imLskjOT1YoV+r7L a1d7YQx4CXsh7K7xd2GKDEZVVmbg9njTwV8XeVfKor08LL2uOlPMhzhI82Yzus+SehIm gSi8iF5wiRp2L966mfWX2p8EZNdL17VU8i94niXPsCzfSuaSAIzpOfbWM3Ccx0EPNsoW 0TlJzVFsV2zx8iEWzGCzGDAbnheFuOCv5tOSpha9dgf3CTHjrdPXQgdDkAZKnnBzBP+K 8VIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ebWGN5Y5JWQXtPnReY9dPz7FYYq7h97okegjpfiP7Zg=; b=KgX9RHd5PAXAM7peyGxXPzwuRP2UpNzWn8rGiEs5q7d1f5sVKTNkELyjx7vbA8NCV7 Q+CVLksN3U9OCmJ0vtOhx8DfvZrktEio8EVv0ok1T9ykrHcpPAEdyk67ZUend9pD/vik ODw+GSrbXySsPjlNEZisQPCdFnQqbTAgSjKLwD5IltxWKDNpsw5xxRVTr7po6BwH4kbV B2qP7ngFrF8XMov7ArsWP1r+pPS6ROSLl7+9H9SSv5Bx3VekcMYABVP8zaYTNdymrJm5 9G2CWdPE1M19kBDkvOn6T9bHdo7qKzilchSEL2Fq5PGtHuyb9v/zFrOhK15nCp03fJMZ iGJg== X-Gm-Message-State: ALyK8tJDI8o4S908DnhNs1Tw6Ob/c2obd5NGkkjiHwL4IyKsB88lkZ9rCjiZ0vewA3AAmu79YyG/oBJVrGyjNw== X-Received: by 10.176.3.11 with SMTP id 11mr5305654uat.146.1467318425571; Thu, 30 Jun 2016 13:27:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.88.148 with HTTP; Thu, 30 Jun 2016 13:27:04 -0700 (PDT) In-Reply-To: <20160630195252.970321A806C6@dd1730.kasserver.com> References: <20160620222835.BC26C1A80609@dd1730.kasserver.com> <14352177-1b49-e2ed-56a3-9a770d0ebf95@gmail.com> <20160630195252.970321A806C6@dd1730.kasserver.com> Date: Thu, 30 Jun 2016 22:27:04 +0200 Message-ID: To: Thomas Bley Cc: smalyshev@gmail.com, michael.vostrikov@gmail.com, PHP internals , rowan.collins@gmail.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] New escaped output operator From: rasmus@mindplay.dk (Rasmus Schultz) 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 norm= ally all new html code is html5. > Maybe split voting between > Regards > Thomas > > =D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB =D0=92=D0=BE=D1=81=D1=82=D1=80=D0=B8= =D0=BA=D0=BE=D0=B2 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 sam= e >> 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 mu= st >> be HTML-encoded. >> >> There is no such problem with other contexts. If we don't call json_enco= de >> 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 m= ost >> 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 context= s. >> 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> ta= g, >>