Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29257 invoked from network); 17 Feb 2015 15:02:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 15:02:38 -0000 Authentication-Results: pb1.pair.com header.from=dennis@birkholz.biz; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dennis@birkholz.biz; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain birkholz.biz does not designate 144.76.185.252 as permitted sender) X-PHP-List-Original-Sender: dennis@birkholz.biz X-Host-Fingerprint: 144.76.185.252 mx01.nexxes.net Received: from [144.76.185.252] ([144.76.185.252:40362] helo=mx01.nexxes.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/D7-19463-B0853E45 for ; Tue, 17 Feb 2015 10:02:37 -0500 Received: from [137.226.183.192] (ip3192.saw.rwth-aachen.de [137.226.183.192]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: db220660-p0g-1@packages.nexxes.net) by mx01.nexxes.net (Postfix) with ESMTPSA id 39D26480CFB for ; Tue, 17 Feb 2015 16:02:32 +0100 (CET) Message-ID: <54E35808.30609@birkholz.biz> Date: Tue, 17 Feb 2015 16:02:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> <54E290E5.3020508@lerdorf.com> <54E2AD88.6040206@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reviving scalar type hints From: dennis@birkholz.biz (Dennis Birkholz) Am 17.02.2015 um 12:30 schrieb Leigh: > And you find taking authority over a library away from the library > author completely acceptable? > > If I write an API that works perfectly well in strict mode, why > shouldn't I be able to turn strict on for my whole library? Do I just > tell users that non-strict mode constitutes undefined behavior for > this library, and refuse to fix any bugs that come up because of it? As the library author you will never ever notice if your library was called in strict mode or not! And that is the point: you will not get any gain from making all your parameters strict, you will just force the user to cast (as Rasmus said already). Repeating that strict mode is required from a library author's point of view does not make it right. You always get the types you want, you just limit the library consumer. But you may want your code call other functions in strict mode to catch some type errors, that is perfectly valid, I don't deny that. Thanks Dennis