Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91714 invoked from network); 22 Jul 2016 13:44:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2016 13:44:12 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.49 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.218.49 mail-oi0-f49.google.com Received: from [209.85.218.49] ([209.85.218.49:36805] helo=mail-oi0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/40-24343-B2322975 for ; Fri, 22 Jul 2016 09:44:11 -0400 Received: by mail-oi0-f49.google.com with SMTP id w18so163132656oiw.3 for ; Fri, 22 Jul 2016 06:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=utBOsN5g1pFcvglixw/vdkgQtLST853g1KFw0etttpk=; b=FQ73DD0R7TV52vjyRQlxRax8UEmtc/Ft+VaFuvcu+QG5K4mFDuZUvsFprdT8/9MtE3 BG+uGjdHuBplmGwDuSCalVXZTVYFcGnwkKyWLk0q1yGrcY/8gIALpvJf3E01rT/BPIWj bQR06/hD1bsSTOu10vlgelkEwfAviXeMSQDXUloVsYITEzeGVvSbHLO3BN2S2c87HJHl zP3AR2XHPpCFLgD52SBbs1UrAOJqyhzkRFo+HHddJZa5DPLItBCyvCzIZbgWEk+MxK+T ju2+TlNabGVbEl0Vvya8Pc+vJ85MtWdVpyeu5DezSfUTOfeqHG51emcyyJFeTGkwVVmS TQiw== 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; bh=utBOsN5g1pFcvglixw/vdkgQtLST853g1KFw0etttpk=; b=j1i8307Qp2U52AXLgU+HnblKDXs90vz9k4LKICnjfSUWmxeJVuoO3VyY4PY1oaTp04 sNnjUfAK09T3vZh0yca23N0q00ivxs47mReFwLRf2vwHTGERsQZDuYEXno0ROtfw8MyO toN6ASrBu7nTkcJlF1IGUB8LAFcSD+6Jh8F3uQriPhyJzU+f0g9nspQO+NiTy3wDC1Qp Pq3xBrT+d9iX2Ln//YyeCcUXeEsLplZ2GmubPaup30Vqv7S5YfwAsHF5Y4uzXhNasOhk u4RHG2ut4uRsbagiC693M5THCFI1L4+zauFZ5kCerVW9aQ1lJGUYS1wbU8LdpixmNnIa eG2A== X-Gm-Message-State: AEkoouuUP6Mq4vxS2L9E4/TEq+Cn8HG3+KPeXgEOmd95uiERor+C7HxLE8hMJ/ARVgu2zwMHd47U8EZ6QuNsqA== X-Received: by 10.157.20.232 with SMTP id r37mr2204419otr.60.1469195047964; Fri, 22 Jul 2016 06:44:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.61.36 with HTTP; Fri, 22 Jul 2016 06:44:07 -0700 (PDT) In-Reply-To: References: <8a39df34-4a23-c496-15f6-20a62d27fc59@gmail.com> Date: Fri, 22 Jul 2016 07:44:07 -0600 Message-ID: To: Michael Vostrikov Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1142e590f0922f053839a023 Subject: Re: [PHP-DEV] [RFC] New operator for context-dependent escaping From: derokorian@gmail.com (Ryan Pallas) --001a1142e590f0922f053839a023 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 22, 2016 at 1:31 AM, Michael Vostrikov < michael.vostrikov@gmail.com> wrote: > > > The trick with the magic class name and namespace aliasing is neat, but > feels likely to confuse a lot of users > > Yes, I have to agree. Maybe more better way is to make it similar to > set_error_handler() - not for context as it is in RFC, but for 'escape' > callable. > > > // somewhere in application > > set_escape_handler(function($string, $context = 'html'){ > ... > }); > > // or > > set_escape_handler([$this, 'escape']); > ?> > > > Which begs the question, if you can verify that the call to set_escape_handler comes before the template, then can you also be sure that a function definition will come before it, and just call a function directly? --001a1142e590f0922f053839a023--