Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38301 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66957 invoked from network); 16 Jun 2008 22:04:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2008 22:04:57 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.200.172 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.200.172 wf-out-1314.google.com Received: from [209.85.200.172] ([209.85.200.172:59933] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/3D-06776-883E6584 for ; Mon, 16 Jun 2008 18:04:57 -0400 Received: by wf-out-1314.google.com with SMTP id 26so5269015wfd.26 for ; Mon, 16 Jun 2008 15:04:54 -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:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=RshopP9sxH69wOEVFjJZMQFlpvX323VMnpPcl2JvEC0=; b=VoqCUlD7WsPbxri+ZaszozKglJ4XzBSUKXA7T9RryNlat9L+WfydbVjBfdRHKCp6MZ bHfMCL/oL6UiDB0Q3gwsR9TSU+E6AGGxWBBAH/jnjKTLrbufulM5pFalwWuwpTscgGIs 0IsxwlV7pNdpJDkzLB230+dXMwQj+TZXN5Eyk= 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:references; b=tDNro7qKH2J7qUjN26Ac6r0ZBLsZ3jkKMDu3xzg5KF2sAjh125rLxTOR1OBuD4qnUs nWUJzRtjmopAeMLDPr8jvDKPEUuFvSNWGNmTomY7XKMYfrpqp4CpTR1IvpmQpNfu7HBT xsE7DieU7dVSxjHRqteBptCzqMLsHZrp1M2oI= Received: by 10.143.2.19 with SMTP id e19mr2596550wfi.90.1213653894258; Mon, 16 Jun 2008 15:04:54 -0700 (PDT) Received: by 10.142.230.16 with HTTP; Mon, 16 Jun 2008 15:04:54 -0700 (PDT) Message-ID: Date: Mon, 16 Jun 2008 15:04:54 -0700 To: "Stanislav Malyshev" Cc: internals@lists.php.net In-Reply-To: <4856D4EF.4000002@zend.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5306_28163889.1213653894254" 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> Subject: Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value) From: chrisstocktonaz@gmail.com ("Chris Stockton") ------=_Part_5306_28163889.1213653894254 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, Jun 16, 2008 at 2:02 PM, Stanislav Malyshev wrote: > Hi! > 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? I get this, really, I do, again. Like the previous post I (likely we) understand. Did you not get or read my post? You say again and again 1 == '1', but you are forgetting those OTHER operators, === and !==. 1 !== '1' does it? ====>Add numeric hinting like I said 50 posts ago and your 1 == '1' problem is solved<==== People who want to make more simple API's will make simple API's offsetting the complexity of your precious 1 '1' to the API level. People who want to make it strictly integer, will continue to do so as they do now. You can not, and should not want to, control the way people program. But I know this will never happen because no one cares what users want... your logic of "We should allow user to check for is_int and is_numeric, resource, object, array, string, etc, within any conditional statement under a function or method. Allow checking for object or array in functions or methods paramters. Disallow anything else from being checked in functions or methods paramters. Follow a philosophy that a user should not be concerned with internal data types. Make sure the user has access to internal data types. User should not have to talk to strict typed systems. But if they do have to make it more difficult then it needs to be because it makes more sense, plus those systems are brain dead." How in the world, does this remotely, possibly, even slightly make sense? -Chris ------=_Part_5306_28163889.1213653894254--