Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53110 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33658 invoked from network); 6 Jun 2011 23:31:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 23:31:15 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:52285] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/E2-20040-0436DED4 for ; Mon, 06 Jun 2011 19:31:15 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 0E5AFDE143; Tue, 7 Jun 2011 00:31:09 +0100 (BST) Date: Tue, 7 Jun 2011 00:31:08 +0100 (BST) X-X-Sender: derick@whisky To: Matthew Weier O'Phinney cc: internals@lists.php.net In-Reply-To: Message-ID: References: <4DED3A29.1090209@sugarcrm.com> <4DED43D4.4070006@sugarcrm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Callable typehint From: derick@php.net (Derick Rethans) On Mon, 6 Jun 2011, Matthew Weier O'Phinney wrote: > The point, though, is that with such a typehint available, we can > reduce boilerplate code like the following: > > public function addCallback($callback) > { > if (!is_callback($callback)) { > throw new InvalidArgumentException(); > } > > The typehint makes this simpler: > > public function addCallback(callback $callback) > > which allows us to rely on PHP's native error handling. I, for one, > would love to see this. That's the same reason why I wanted scalar type hints.... cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug