Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13361 invoked from network); 4 May 2017 15:55:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2017 15:55:45 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.192.180 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.192.180 mail-pf0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:34711] helo=mail-pf0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/A6-02776-00F4B095 for ; Thu, 04 May 2017 11:55:45 -0400 Received: by mail-pf0-f180.google.com with SMTP id e64so9653534pfd.1 for ; Thu, 04 May 2017 08:55:44 -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=xzRfHTeNGck4t5TXBmer8d17CZYZueLc1h785M8XMN0=; b=ARx2Cox9j+7eMhmn73qjBZbtbNKTb1xona1zV90xgRV2Ads1E6KPOXo3ZPlPip7pP7 KqxK7xAFkhyxBxZ0O1H95Ysm9DJrA6Ln24LKxHhwES9g39I+d4wckwbdR9hJs9s7gUP+ s6qE24jBPQLupIvfWrDGS2wkOEZtF0TYPwxNbrfX1vyxg5p8V8jf/aLyZ4gTG/564TXD WyqEFvfrgeWkEFMJomEbkQGxVt0uoRnaTRHpGU5RWjPDonffieZ0FDqrJffiaJDqw6GT ZRxgEIjL4WNO9OenDOZn+WV376BT2peCgpAnazrT6vo/ZWSDxGzi/osnHqzHFrtI2Rqr 2D+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xzRfHTeNGck4t5TXBmer8d17CZYZueLc1h785M8XMN0=; b=RqqifPozibSB1JZOQ53X42SFunHuJXc3HtCT3JwlWh3kPdBCTJl1XjcwhB2hEYhdhO UOMfjG2w+b2elwYDCMQuJsuyGF1wp0GVtE7KgzFodw6nWltoV3u0Ctez1yEBJ9ebFPLm Ms5uN5kBcLr97lJGDkFVx7LEArhWTsUgUU7vknLAqs8aduZcTiHDAjapib7HZ1Jrqx/Z y2qD0MlxnsAXk+ZBM3B3awqI4jRQRWxC7TqoH9OMmalDfsnTvzcJg1oLlU/jbbfCkRa3 6sV3k9K8gP+eXK1yVNWje6Mk8kSLyfYFgB+BtDIv1FADlbUtcVP1rFYe1GE8EZpQ9Cko VRcg== X-Gm-Message-State: AN3rC/7gRVQ6sGe7hLJyI+f9G3PV0y/KrWprgc9+Mi6K+btXhm4ISpzV ezRCTIw463ou5pG9v8Eqx/6ecdHIkj7bzXs= X-Received: by 10.98.204.155 with SMTP id j27mr11641979pfk.213.1493913341776; Thu, 04 May 2017 08:55:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.181.197 with HTTP; Thu, 4 May 2017 08:55:41 -0700 (PDT) X-Originating-IP: [81.143.203.71] In-Reply-To: <20170503032357.69de58d8@eto-mona.office.smartweb.sk> References: <20170427115041.06339340@eto-mona.office.smartweb.sk> <20170428044910.01fc1d66@eto-mona.office.smartweb.sk> <20170503032357.69de58d8@eto-mona.office.smartweb.sk> Date: Thu, 4 May 2017 16:55:41 +0100 Message-ID: To: et.code@ethome.sk Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] concept: further improvement of filter extension, "generalising" filter definitons while adding new callback filter type From: danack@basereality.com (Dan Ackroyd) On 3 May 2017 at 02:23, Martin "eto" Misuth wrote: > > there is one thing I don't know what to do about, and need your advice. What > about module name clash? I would prefer, for this alternative module, to be > named filter as well IMO that violates the principle of least astonishment - a function that has the same name as an internal PHP function doing something different. However if you really want to do that, 'overloading' internal functions can be achieved by (ab)using namespaces: namespace Foo { function filter_var($input, $filter = FILTER_DEFAULT ,$options = []) { echo "I am a custom filter function"; return $input; } } namespace Bar { use function Foo\filter_var as filter_var; $val = filter_var("someInput"); } Output is "I am a custom filter function" cheers Dan