Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55831 invoked from network); 17 Feb 2015 15:22:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 15:22:59 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.181 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.181 mail-qc0-f181.google.com Received: from [209.85.216.181] ([209.85.216.181:61686] helo=mail-qc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/AD-19463-2DC53E45 for ; Tue, 17 Feb 2015 10:22:59 -0500 Received: by mail-qc0-f181.google.com with SMTP id p6so29159623qcv.12 for ; Tue, 17 Feb 2015 07:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=csJjqHj/7L9o7y7mQKXG15ccC4Pnr4DMWfedYA0RB38=; b=BvJGrCARAWWT3RAE4juoI/jOoTLQRpenmo+JblUnBAs2AMItKRGMTdHwTXx7eFXnKp DrK0PDrL9DuFYxZh16kEe5pmAb093LY7W67sVn67cUZqIaotiyRsD12PgjVXVSMe47ot UO4vLUXDWSQRjRh+i0iv7Xco96Q2np77MRM0rUA9vG81XDDG0Aa+Gz1iBOHRhY27RUAQ tuGXNj1pZt6bL8v6ZI/1EJghbhHhf8cPShy1M8Dx8pHTCUQ7CfWEZhXAQG1LuwnNW6cj lDjIk9svabvKCQAP6hC0FZ8TxcuqeFuhr2PGSCwvx/Hk1UU6xPJ8ANJHeBkW+1I5Zhog N6Jg== MIME-Version: 1.0 X-Received: by 10.229.190.6 with SMTP id dg6mr55674qcb.16.1424186575627; Tue, 17 Feb 2015 07:22:55 -0800 (PST) Received: by 10.96.39.195 with HTTP; Tue, 17 Feb 2015 07:22:55 -0800 (PST) In-Reply-To: <54E35808.30609@birkholz.biz> References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> <54E290E5.3020508@lerdorf.com> <54E2AD88.6040206@lerdorf.com> <54E35808.30609@birkholz.biz> Date: Tue, 17 Feb 2015 07:22:55 -0800 Message-ID: To: Dennis Birkholz Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Reviving scalar type hints From: pierre.php@gmail.com (Pierre Joye) On Tue, Feb 17, 2015 at 7:02 AM, Dennis Birkholz wrote: > 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). No, and Rasmus examples, while being technically correct for some of them, just add confusions to the stack. The caller, and the calls to internals function in the caller codes, won't be affected, at all. Please understand it. Only the library code will. Now we can surely find other cases where we may adapt the patch or be more obvious, but for my own sake, get over this "it will break and change everything everywhere", it does not. > 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. No, you do not.