Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74789 invoked from network); 22 May 2010 22:01:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 May 2010 22:01:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-ww0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:42517] helo=mail-ww0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/F2-46027-42458FB4 for ; Sat, 22 May 2010 18:01:08 -0400 Received: by wwi17 with SMTP id 17so1433994wwi.29 for ; Sat, 22 May 2010 15:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=/0oRc/cX60iYRA3EudM6WBnU9D9FDOooCQsqMesI2f0=; b=iRlj58/OoH1B/4QjI00i1Sz4m9LRUogWkSvScOKWTQRK4SQOcBW+Q10eosI+TEfn0C UHnuBsDqPlrIHxz02Sz92A1lQc5czxf/+3Q4CWMa7D2A0UrO5aAv/zTo/i2NSqbxVf0Q Xa3K/DcQQpEeYFaf3bk8rnmplCUkToytihpIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EG6KqD4J1+3t0Ha/jb9eM82nDEffdgJ5wJaeJolyAXnyEkRXSwiOrV8AsipmBsVLbe Di3zj4ifBu6HLPs9GxLAnRIfTnvlCnBRd7QHb0be/Npzsi7RH+j0qHCni2WlZZyTZ/Ac 5V9SsMV9kLEYx7uDGZX9FYItnjZRjhx18f3pk= MIME-Version: 1.0 Received: by 10.216.168.135 with SMTP id k7mr1984063wel.129.1274565664459; Sat, 22 May 2010 15:01:04 -0700 (PDT) Received: by 10.216.179.130 with HTTP; Sat, 22 May 2010 15:01:04 -0700 (PDT) In-Reply-To: <93EFAEF4-26F3-44A1-85ED-5E71E665B966@pooteeweet.org> References: <7.0.1.0.2.20100522175819.0a601c68@zend.com> <93EFAEF4-26F3-44A1-85ED-5E71E665B966@pooteeweet.org> Date: Sun, 23 May 2010 00:01:04 +0200 Message-ID: To: Lukas Kahwe Smith Cc: Josh Davis , Zeev Suraski , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Type hinting From: hannes.magnusson@gmail.com (Hannes Magnusson) On Sat, May 22, 2010 at 22:39, Lukas Kahwe Smith wrote: > > On 22.05.2010, at 18:30, Josh Davis wrote: > >> As you wrote, you worked on PHP's _type system_ which is dynamic, >> really cool, juggles strings with ints and what not. However, the >> topic here is the _type hinting system_. As far as I know, there's no >> "weak" type hinting; if a method signature hints for an array and is >> given an integer, it throws a catchable fatal error. Therefore, as a >> user, what I am familiar to is a strict _type hinting system_. >> Anything else would feel inconsistent to me. I agree. function foo(array $x) {} foo(123); doesn't cast int(123) to array(123) so introducing different meaning for scalar types feels very very wrong. > can we please just stop calling a something a "type hinting" system, which leads to a catchable fatal error when the type does not strictly match? thats a very misleading euphemism. its simply strict typing, it has nothing to do with hinting. > It definitely isn't strict either: $ php -r 'function errh() {} set_error_handler("errh", E_RECOVERABLE_ERROR); function bar(foo $x) {echo "hello world\n";} bar(1);' hello world -Hannes