Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85204 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87828 invoked from network); 18 Mar 2015 22:46:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2015 22:46:30 -0000 Authentication-Results: pb1.pair.com header.from=sbj.ml.read@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=sbj.ml.read@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.179 as permitted sender) X-PHP-List-Original-Sender: sbj.ml.read@gmail.com X-Host-Fingerprint: 209.85.213.179 mail-ig0-f179.google.com Received: from [209.85.213.179] ([209.85.213.179:32955] helo=mail-ig0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/A0-16839-6400A055 for ; Wed, 18 Mar 2015 17:46:30 -0500 Received: by ignm3 with SMTP id m3so38340ign.0 for ; Wed, 18 Mar 2015 15:46:27 -0700 (PDT) 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=G6ieER7aEtaVXv3IHWraXBKUd9uw9EE2GjiDIx+aTQE=; b=RzfYJJPChJ3+NE68RPgJ4KKOUcSdcu9q4bapfakrMXVPDrnXtYISnYdHLnys7p+nyD rU/d3MROT/5lguevLgcGc8YKJrYQTz6TBjCwkiap3dzsenOvAZMS8CVno2ipMjOYkfE5 sdKCFOgH327Bfvjv4VcrOOaJZCiZfNRyEb37cy8JQxX+iRpSi16WKxvPXWf4pPMB+lRj LXJuewxfN8BFCekfddMoCrCAiWhMLh7d/KBbllItap+lXaMXBwZDcMa6oo5CIAFaMEDg +267qEY51f2XDkl7pjdkx3v5E7oKEaTyx6DwVjrFazzZewv7Rm3J+HxoddJvSxTn4zHV Um5Q== MIME-Version: 1.0 X-Received: by 10.50.79.229 with SMTP id m5mr11196156igx.23.1426718787826; Wed, 18 Mar 2015 15:46:27 -0700 (PDT) Received: by 10.107.132.5 with HTTP; Wed, 18 Mar 2015 15:46:27 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Mar 2015 23:46:27 +0100 Message-ID: To: Lazare Inepologlou Cc: Chris Wright , =?UTF-8?Q?Pavel_Kou=C5=99il?= , Nikita Nefedov , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5 From: sbj.ml.read@gmail.com ("Sebastian B.-Hagensen") Hi, 2015-03-18 20:42 GMT+01:00 Lazare Inepologlou : > However, it seems that the second form is possible to fail, and that > depends on the mode (strict or not) of the library that contains the > function a. It does not depend on the mode that I have chosen to work with. > The two closures will not work in the same way and that's a kind of a WTF > moment. If the library documents that it is passing an int or an intable value in non-strict to the callback and it does not do so it has a bug. If the library does not declare a type and you hint an int and it passes something else, you created a bug. However, to work in a real code base some discipline and clean documentation from the library author is required. But I agree that this is currently fragile. Having a way to hint a callables signature may not solve the issue , but make it easier to catch and shift most, if not all, responsibility to the library author.