Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87199 invoked by uid 1010); 3 Jan 2008 23:46:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87183 invoked from network); 3 Jan 2008 23:46:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2008 23:46:51 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.184 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.198.184 rv-out-0910.google.com Received: from [209.85.198.184] ([209.85.198.184:56648] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/A5-20810-5E37D774 for ; Thu, 03 Jan 2008 18:46:49 -0500 Received: by rv-out-0910.google.com with SMTP id k15so4823181rvb.23 for ; Thu, 03 Jan 2008 15:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=hFpQXKcjeoMCV8n5mGpSH089ltv63h4dKCiFnKwZisE=; b=E9Do/qpUHbAcJMnD5gQdJMCwv9tNEb06xW4mgDv+1VihV83lLsMYg5LAcM2QfeB2PlBZdkUj31FpNIO4Cg4OQ9+5ZXEkpme33Jwm6ocEtCtjrmDDe2JQlzW9eyhuOLqlYl2wVe5UuKax8AAK5TzwmYPSxgEbkssdqPrTQ2kd7yM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uKksfQHhLvtf053V3RUbRxUuwd+XkoJ5kU3VnxBD3K7N6SJ/1n6Lq6mJlbkfL1l/3SivFLPJ0iUdUftZfMsKHpCZfZvYUW5o3I3ytzg//ZYm7V66sVP/NUTTl+evE6j7r0MRJ0cS2ZjoNLG6OuAE0hpGlxUxs783I+ORQr+meyA= Received: by 10.141.18.14 with SMTP id v14mr8447226rvi.252.1199404002631; Thu, 03 Jan 2008 15:46:42 -0800 (PST) Received: by 10.141.177.21 with HTTP; Thu, 3 Jan 2008 15:46:42 -0800 (PST) Message-ID: Date: Fri, 4 Jan 2008 00:46:42 +0100 To: "Stanislav Malyshev" Cc: "=?ISO-8859-2?Q?Pawe=B3_Stradomski?=" , internals@lists.php.net In-Reply-To: <477D6E68.5090501@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200801031903.01980.tomi@cumulo.fi> <477D66B4.2000107@zend.com> <200801040008.43944.pstradomski@gmail.com> <477D6E68.5090501@zend.com> Subject: Re: [PHP-DEV] RE: Optional scalar type hinting From: pierre.php@gmail.com (Pierre) On Jan 4, 2008 12:23 AM, Stanislav Malyshev wrote: > > This code is just a good argument *FOR* type hints. When foo is: > > function foo(int $bar) {...} > > and you want the code to die if $bar is not integer, then foo($bar) would be > > Why would you want it? I wouldn't want my code to die, I would want it > to work. > > > you have either an int or string representing an integer in $bar, then > > foo((integer)$bar) would work just well. > > And then how exactly strict typing helps you? You can not control at > development time if everybody uses (integer) or not, since being > interpreted PHP has no static type checking. So only option to find it > out is to leave a minefield behind hoping that testers and not actual > users would be ones who make it blow up. What if testers fail to find it? Check google for all fatal errors we introduced about OO strictness (or getter/setter) and you will see what does that mean to be unclear about how strict one should be. I'm not arguing to force strictness but I would love to have it, on a per class basis for example (). -- Pierre http://blog.thepimp.net | http://www.libgd.org