Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38299 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53402 invoked from network); 16 Jun 2008 21:06:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2008 21:06:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:56798] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/EA-06776-8B5D6584 for ; Mon, 16 Jun 2008 17:06:01 -0400 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id ECFA51EBC018; Mon, 16 Jun 2008 21:07:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e494l3TbgNZ4; Mon, 16 Jun 2008 23:07:43 +0200 (CEST) Received: from [192.168.0.151] (77-57-23-243.dclient.hispeed.ch [77.57.23.243]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 937F51EBC013; Mon, 16 Jun 2008 23:07:42 +0200 (CEST) Cc: Chris Stockton , internals@lists.php.net Message-ID: <8145E047-64C4-4DC3-B6D4-2D9353075875@pooteeweet.org> To: Stanislav Malyshev In-Reply-To: <4856D4EF.4000002@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Date: Mon, 16 Jun 2008 23:05:29 +0200 References: <46ccd1ab0804170742g142ed562t4f03339da549a820@mail.gmail.com> <48077BD2.2000107@zend.com> <48078168.1070801@zend.com> <496536410.20080525103752@marcus-boerger.de> <483929DC.2060606@zend.com> <4856D4EF.4000002@zend.com> X-Mailer: Apple Mail (2.924) Subject: Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value) From: mls@pooteeweet.org (Lukas Kahwe Smith) On 16.06.2008, at 23:02, Stanislav Malyshev wrote: > So you just ignored the "special cases" part. Yes, if you have special > case where you interface with very brain-dead strictly typed system > that > absolutely can't understand that '1' and 1 is the same - then you > need to _convert_. So how failing when you get '1' instead of 1 > helps you? You'd need _conversion_, not _failure_ - and if you write > strictly-typed API, you'd move the conversion responsibility to the > user, instead of having it where it belongs - in the API. That's > *exactly* why I see strict typing in PHP so dangerous - it promotes > lazyness and sloppiness in API writing, and those APIs will be a > nightmare to use, since they would bomb out on slightest > disagreement about internal engine types, which the API user > shouldn't care about at all. What happened with "be liberal at what > you accept"? > In strict compiled languages, the compiler and IDE will guide you > through this, in PHP you'd just have it explode in your face in > production. How this is good for anybody? amen. regards, Lukas Kahwe Smith mls@pooteeweet.org