Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94522 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45473 invoked from network); 16 Jul 2016 20:24:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2016 20:24:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.161.176 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.161.176 mail-yw0-f176.google.com Received: from [209.85.161.176] ([209.85.161.176:36535] helo=mail-yw0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/51-31884-4189A875 for ; Sat, 16 Jul 2016 16:24:53 -0400 Received: by mail-yw0-f176.google.com with SMTP id c124so3184844ywd.3 for ; Sat, 16 Jul 2016 13:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=m+28rjemoD+XKP/jAQoqECid6ecq1sgAi7VpLE62jso=; b=IXSaij5MHODFyju78Kk8Dopm4P0e8PhtVmd7nyxhgFCGYg1tdeF7dOtrrROsDTle6d JrfKEVIT4/x0Ig8LP76olDT5PoW7He2T5W8JQzTqfVgwT/UgahzbaYHycPTLNqsCUp+I SM2hEUgC5cPF8TJO9p9wkTUBrflEo/kpXwsLjPxlhk8WrTP5TG/OmPEU+4aKmkCk2pJ9 VMWkj4rK6aTZTpYs5j9TPM/Z7jC+9I8uCZKufAdDnJhNCedpD+Llf6wTgY+fekLxYmxY V5Z+1T4rrXkUheL2xyWX82NJ3WEiFfcC2Sx6B7O6kHSewSDDEUkKGv5XDT0kO7ZCeWqS iJHA== 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=m+28rjemoD+XKP/jAQoqECid6ecq1sgAi7VpLE62jso=; b=G7ufcmoIK5rpGexSb0wKoyGYnzTVDarSfQtb5HlshUOuuLH/sdqPFu9oxGqcz1zide KxcrRUMddYtjb2G5dmYxOXUpEAZX3+j0P8advy+t/AKAazOsNKQ4Z+QTJ7Fb64w+d5H/ JIKY4VSH99BfaKRQHYRmHBN6CfEUvzgMV/joHPD2+UOqigGPiHiE8m0Orpu2JqcXKpug KEP3obI7eQ6pJULfX6tKyys/7nM3imrGXE52nlbA4jVuQJt6lr29ChJRfaY7WZGyDRKA 2yy1zA1efVx1Vm007o6Q0BwsE5PV9wdiwCENTPSLb5FoqUwG1xsUA57Kee0M45roqdzr KLPw== X-Gm-Message-State: ALyK8tKowEpxQ0bnW2a/93CcmY1mnMcXBKNugD7wOrgZ0hzH130Sl3FLMCtHJqESikF0W6BabNVaX+sLeVv3aQ== X-Received: by 10.37.215.18 with SMTP id o18mr2898907ybg.134.1468700690293; Sat, 16 Jul 2016 13:24:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.230.132 with HTTP; Sat, 16 Jul 2016 13:24:49 -0700 (PDT) X-Originating-IP: [78.145.249.217] In-Reply-To: References: Date: Sat, 16 Jul 2016 21:24:49 +0100 Message-ID: To: Michael Vostrikov Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] New operator for context-dependent escaping From: danack@basereality.com (Dan Ackroyd) Hi Michael, On 16 July 2016 at 16:33, Michael Vostrikov wrote: > Hello. > I have created RFC about context-dependent escaping operator. > https://wiki.php.net/rfc/escaping_operator > > Initial discussion was here: http://marc.info/?t=146619199100001 I'm more than slightly sceptical about this RFC's chances, but to give you some feedback, this bit is a bad pattern: > bool PHPEscaper::registerHandler(string $context, callable $escaper_function) > > Registers new handler for a given context. If handler for this context is already > registered, it returns false, on success registration returns true. It would be better to return the previous handler, or NULL if one wasn't set, in the same way as set_error_handler() does, and for the same reasons. Also, shouldn't these just be functions? Why is there a class involved when it only has static functions/state? cheers Dan