Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97316 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53381 invoked from network); 7 Dec 2016 04:42:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2016 04:42:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:33940] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/F7-11772-B4397485 for ; Tue, 06 Dec 2016 23:42:52 -0500 Received: (qmail 80732 invoked by uid 89); 7 Dec 2016 04:42:48 -0000 Received: from unknown (HELO mail-wj0-f180.google.com) (yohgaki@ohgaki.net@209.85.210.180) by 0 with ESMTPA; 7 Dec 2016 04:42:48 -0000 Received: by mail-wj0-f180.google.com with SMTP id tg4so92134720wjb.1 for ; Tue, 06 Dec 2016 20:42:48 -0800 (PST) X-Gm-Message-State: AKaTC03aV2Czp9SbwcbbQXOdDXM2La+NsFMzUGkpGlHxZC8kn/C2t0u8T1gVJd7aR/5qgHjcpp7h26fMAFvKVQ== X-Received: by 10.194.231.8 with SMTP id tc8mr56568145wjc.193.1481085761418; Tue, 06 Dec 2016 20:42:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.38.7 with HTTP; Tue, 6 Dec 2016 20:42:00 -0800 (PST) In-Reply-To: References: Date: Wed, 7 Dec 2016 13:42:00 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Bob Weinand Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][VOTE] User defined session serializer From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Bob, On Tue, Dec 6, 2016 at 10:36 PM, Bob Weinand wrote: > Am 06.12.2016 um 08:06 schrieb Yasuo Ohgaki : > > Hi all, > > *snip* > > * Why it does not use exception for error? > > Session module uses "errors", not "exceptions" basically. Session save > handler uses "errors" also. We should avoid inconsistency in a module. > Exception adoption will be addressed and exceptions will be used > consistent manner by other RFC. > > > This is not session module specific, your interface is specifying a return > type. Thus this should be enforced on the interface implementation level. > (I.e. it will be impossible for an user to define a function not having a > return type of string/array) > > Also, if a wrong argument is passed to a function, it should throw a type > error. Perhaps old modules from pre-PHP 5 do emit warnings or recoverables, > but we then shall transition from that to TypeError, and definitely use > TypeError in new functionality. If we use TypeError for this, session will be the first module that uses TypeError in module. It may be better to use TypeError with caution. Let's have a RFC for exception usage guideline. There isn't clear consensus how we should use exceptions now. When we have consensus, we follow the guideline. For the time being, let exception usage is out of this RFC scope Since this RFC is targeting master (7.2), we have enough time for exception adoption. P.S. I don't like mixing errors and exceptions for submodules, serialize and save handler. Please note that save handlers raise "error" for invalid return types currently. If a module should adopt exception, all applicable errors should be changed to exception at once, and patch work should be avoided. IMO. -- Yasuo Ohgaki yohgaki@ohgaki.net