Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36095 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14721 invoked from network); 11 Mar 2008 10:25:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2008 10:25:16 -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.187 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.187 rv-out-0910.google.com Received: from [209.85.198.187] ([209.85.198.187:50873] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/E4-21537-80E56D74 for ; Tue, 11 Mar 2008 05:25:14 -0500 Received: by rv-out-0910.google.com with SMTP id k15so1629731rvb.23 for ; Tue, 11 Mar 2008 03:25:10 -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:content-transfer-encoding:content-disposition:references; bh=xKISM1JTzpIE3TyEDvZC2T+d4BEz88jqRLrARuyxl/s=; b=EWTEIqBS4g7wOVcQe66De5EaLtbbaZ7PsINUSDNonX+ckYdXmyd62FEmcLpPz4mxDwUr2TRzNDiOJuFC4OIVQix5eMVosr9TZnfqRCDhebvSupGpd4vthFRxqBS640CnVPnxuQbpbQ80UJGr/6Ki0OleO3sPvJszTgGgARmha+A= 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=XmJYAyksClRRlT7o7wnEtoS7XH04iUTekULmRFCD+3g7TRkyA7BjD24DJhSV2F61bwrVwt2ZBurwZ392sq/h8O/enWyYglK2pqyesqvS+Z2p2jCkSdCLMUYpyv8OfRkJSTFNEIWnwBqUD3lFphNQv3qW2FLocmvUtu4Npn+sxYk= Received: by 10.140.174.11 with SMTP id w11mr137010rve.71.1205231110053; Tue, 11 Mar 2008 03:25:10 -0700 (PDT) Received: by 10.141.116.12 with HTTP; Tue, 11 Mar 2008 03:25:10 -0700 (PDT) Message-ID: Date: Tue, 11 Mar 2008 11:25:10 +0100 To: "Scott McNaught [Synergy 8]" Cc: internals@lists.php.net In-Reply-To: <-1466067017711567869@unknownmsgid> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080311094214.GA4264@redhat.com> <-1466067017711567869@unknownmsgid> Subject: Re: [PHP-DEV] Comparison: ('*' == 0) ... True or false From: pierre.php@gmail.com ("Pierre Joye") On Tue, Mar 11, 2008 at 11:17 AM, Scott McNaught [Synergy 8] wrote: > Hey guys, > > I don't know whether to post this as a bug or not. But I was tricked when programming today. > > It seems that the character "*" is non-strictly equivalent to 0. Is this the correct behavior or am I missing something? > > Test case: > > > var_dump('*' == 0); > > ?> > > Shows boolean(true). > > I was unable to find any documentation as to why this would be the case. http://www.php.net/manual/en/language.operators.comparison.php -- Pierre http://blog.thepimp.net | http://www.libgd.org