Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44636 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13975 invoked from network); 2 Jul 2009 11:33:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 11:33:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=ionut.g.stan@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ionut.g.stan@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.206 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ionut.g.stan@gmail.com X-Host-Fingerprint: 209.85.218.206 mail-bw0-f206.google.com Received: from [209.85.218.206] ([209.85.218.206:62430] helo=mail-bw0-f206.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/30-12594-70B9C4A4 for ; Thu, 02 Jul 2009 07:33:30 -0400 Received: by bwz2 with SMTP id 2so1001063bwz.23 for ; Thu, 02 Jul 2009 04:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=pxhxE/PNQxy0Q+QZwEbg1WzqAd9xMV5K27yJzGFhQGY=; b=qtP5Jxulxw4vB1iqgBTKh9fD7ZG9TVu88FT71IuuYxSEbc/kOKK/uDXwUSX3oW4m7l siMhO3KAiNdQzOEgEjbxFuvjs4AGHtxsoIW3xeQynILAHzzhkI+WOYDuXm9CAx6S5PQc Twd8pvS8eFaU3aoB4+mZ9gJF3f+gLM5ZegWJg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; b=l7yIGuHd1YVmvIenlMNirUOpOXm0R1lrscaevatPn3wUy5Y3wVRbxouhitNaEfkkIF 5af++qOMy/8s56jNoLk65R31QuTDgay7pDfVtgW3AqlAijhwZbNP59yeOsIs3N+xyT0x 24Pfhs+MyaH1Zrop+LUOioC0SROilNtqe/HB0= Received: by 10.103.2.14 with SMTP id e14mr6290788mui.41.1246534404352; Thu, 02 Jul 2009 04:33:24 -0700 (PDT) Received: from ?10.0.0.187? (mail.cmbtravel.ro [84.234.105.22]) by mx.google.com with ESMTPS id t10sm11125825muh.30.2009.07.02.04.33.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Jul 2009 04:33:23 -0700 (PDT) Message-ID: <4A4C9A8F.4060107@gmail.com> Date: Thu, 02 Jul 2009 14:31:27 +0300 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 CC: PHP internals References: <4A4C7CE6.6070107@gmail.com> <7f3ed2c30907020356s45fd2c56l30b77e92fec61a8c@mail.gmail.com> In-Reply-To: <7f3ed2c30907020356s45fd2c56l30b77e92fec61a8c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: ionut.g.stan@gmail.com ("Ionut G. Stan") On 7/2/2009 13:56, Hannes Magnusson wrote: > function throw_exception($errno, $errmsg) { > if (strpos($errmsg, "Argument ") === 0) { > throw new InvalidArgumentException($errmsg, $errno); > } > return false; > } > set_error_handler("throw_exception", E_RECOVERABLE_ERROR); > > function foo(array $arr) {} > foo("string"); > Actually, I'd use an exception class which extends from the builtin ErrorException class, but that's not the point. Anyway, probably Kalle Sommer Nielsen is right, and the way PHP already behaves in that regard should be kept. At least for now. -- Ionut G. Stan I'm under construction | http://igstan.blogspot.com/