Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59896 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49244 invoked from network); 13 Apr 2012 18:40:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2012 18:40:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=mjpelmear@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mjpelmear@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: mjpelmear@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:45649] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/95-35770-C03788F4 for ; Fri, 13 Apr 2012 14:40:12 -0400 Received: by obbta17 with SMTP id ta17so3785122obb.29 for ; Fri, 13 Apr 2012 11:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+qOOc4JziixtxUguavczoGPj8JMzk9QBj0+y1Fm6Mm0=; b=ikJ6QuojW/ffq7yjH/cZMpZKmI2GCnCIeIpTmF0jDr9NBIJzRHuyTzE13tFcPWaP4v uz1R9ZhVZKNwM6cyG/MrLtE72D9r/N/Cu4V6kybscqbYXh8e59iW4zfuqYHIQFlBKv7k f1NG+yWHEEwXwgTz4kcHf+R75+OWrvX+h/zQewk9B2MpjA+pUantWK3f2TsyTFPPiPNH z+JsPZGhUcJO6sGAnoudpog8WqDdtQ0y+OyvDkr3R8gQK8X7jHAetcbA/dAtEMykP22J 8knkVet0Y6CwVgs0risHleVGNOq9bRLPMzhjEt3zR2++zKvf9/g1BhAUovwfeUMy+pcA INeA== Received: by 10.182.40.7 with SMTP id t7mr3408367obk.55.1334342409697; Fri, 13 Apr 2012 11:40:09 -0700 (PDT) Received: from [192.168.1.120] (cpe-98-154-250-197.socal.res.rr.com. [98.154.250.197]) by mx.google.com with ESMTPS id in4sm11024146obb.2.2012.04.13.11.40.07 (version=SSLv3 cipher=OTHER); Fri, 13 Apr 2012 11:40:08 -0700 (PDT) Message-ID: <4F887306.3060302@gmail.com> Date: Fri, 13 Apr 2012 11:40:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 MIME-Version: 1.0 To: internals@lists.php.net References: <4F884FB4.70901@sugarcrm.com> <4F885077.6060800@lerdorf.com> In-Reply-To: <4F885077.6060800@lerdorf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] '9223372036854775807' == '9223372036854775808' From: mjpelmear@gmail.com (Matt Pelmear) On 04/13/2012 09:12 AM, Rasmus Lerdorf wrote: > On 04/13/2012 09:09 AM, Stas Malyshev wrote: >> However I think it would make sense not to use this conversion in string >> comparisons when we know it's lossy - it seems to be outside of the use >> case for such comparisons and it seems apparent by now that it is hard >> for people to understand why it works this way. > Yup, I agree, if the type juggling loses data we should skip the juggle > and do a direct comparison which I think is what Gustavo's patch does. > If people explicitly cast things then the cast, even if it is lossy, > should happen. > > -Rasmus > Sadly when I proposed this many months ago my post was ignored. :-( Just chiming in to say +1 for this type of operation. This problem was extremely frustrating and took a while to figure out exactly what was going on, as I had wrongly assumed casting to string at the comparison would cause a strcmp. -Matt