Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92647 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48435 invoked from network); 22 Apr 2016 15:19:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2016 15:19:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:34537] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/68-14036-5E04A175 for ; Fri, 22 Apr 2016 11:19:06 -0400 Received: by mail-lb0-f179.google.com with SMTP id b1so40221905lbi.1 for ; Fri, 22 Apr 2016 08:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:subject:references:date:mime-version:content-transfer-encoding :from:message-id:in-reply-to:user-agent; bh=AK4tv9vY+oVp+W2ts+tA2l6U0kRyz2kmjqzhqBhw18M=; b=Cyxa0KV/x1SGkfd/cU9Pn9clBOAJHzBsonwHJVsi68gdOQ/i06ODlrDqnOm717IZco iE98aGLQIdspovOZ/MrZztVmlujG4MlkbPZgP/FGRcCYnBOzVxrUHFO/vTXwmG0dvUUq H4weft+N+fQ/92BdtTQ0MlMMxWSrNM74EJZlDni/TGR3LmyOLC4TU3knqVy/MrbdOgCE YSqxK0BYLN6ZIdnLeJiODo3JXQ1u5+Va2PbX4FIpfv2Ujnm5YVmAj5NXPs0Vx/r41sjY l9klN7RQmqDWc+sDPksm7QPfd8pccL8fjK03XzVlBX0NhEoiBVW7iDxUlSGLy8X8F4UE I7YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=AK4tv9vY+oVp+W2ts+tA2l6U0kRyz2kmjqzhqBhw18M=; b=bnnmfsSF6EbNMXwslLOXVwgA9SPWN3KxNuaZbSy/w/bleeWAgFhbVdpNALB/m1rjoE AjRpmFnIF5mE6y2aUwqcnX6hGRjtQeVrsS2BzsmzMuN0WMXXyECual2T4zxI89Meo+1F RjcwccmCk2jjRI58DErdQOwyjHjpC353aLxbIidqRHyp3tzT68g9/z6Vc9xrTSF7Lpnz Y3hT3PFp2zH4z2iKy301qYan1dfRPBVjxfAkT5Y7IdmTNgrK9bjDev4ZuI6epZ+rVBVj qkF7ZiXsomjlBt1oP4ceCnwiR0in3IeLk+rmmZeUZ10ZRHQHQ3g0xOeQRQK/PUb0BlBf rObA== X-Gm-Message-State: AOPr4FXTrsz9ar0grngyeKMFXgkFWogxobJGC50H1zAuC9jbn0uR77YdTaNC33v08YUHyw== X-Received: by 10.112.141.197 with SMTP id rq5mr8803380lbb.5.1461338338836; Fri, 22 Apr 2016 08:18:58 -0700 (PDT) Received: from nikita-work-box ([185.62.192.230]) by smtp.gmail.com with ESMTPSA id k6sm1682298lby.49.2016.04.22.08.18.57 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Apr 2016 08:18:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Fri, 22 Apr 2016 18:18:49 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (Linux) Subject: Re: [PHP-DEV][RFC] Callable Types From: inefedor@gmail.com ("Nikita Nefedov") On Fri, 22 Apr 2016 07:12:13 +0300, Marcio Almada = wrote: > Hello everyone, > > We just completed the draft for the "Callable Types" RFC. This RFC has= = > been > recently mentioned during other type related threads on this mailing = > list, > so it feels to be the right time to put the proposal in context: > > The proposal is at https://wiki.php.net/rfc/callable-types > > The W.I.P patch is available for testing through http://3v4l.org under= = > the > RFC tab. > > We count with your detailed feedback and insights. Let's have a nice, > respectful and > constructive conversation about the RFC and work on possible = > improvements! > > Thanks > Nikita Nefedov > M=C3=A1rcio Almada Hello internals, We're still having a hard time finding a proper format for error message= about incompatible callable being passed. Right now it looks like this: Uncaught TypeError: Argument 3 passed to reduce() must be callable = of = compliant signature: callable(integer, integer): integer, callable($a, $= b, = $c) given, called in ... Although it goes in the fashion with all other TypeErrors but it's obviously very cryptic and it will be hard to read for human. One of the alternatives Marcio proposed was: Uncaught TypeError: Argument 3 passed to reduce() must be compliant= = with callable(integer, integer): integer, incompatible callable($a, $b, = = $c) received, called in ... This is remarkably more readable but if you have any suggestions you're = = welcome. Actually I think other type errors are not very readable as well, take = f.e.: Argument 1 passed to foo() must be an instance of string, boolean g= iven The fact that `string` and `boolean` are separated by only one comma, and the way `boolean given` is worded (verb after noun) makes it harder to read. So maybe we could reconsider type error messages and change the= m to something more user-friendly, if there's support for this idea...