Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70175 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25759 invoked from network); 16 Nov 2013 17:16:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2013 17:16:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=william.a.bartlett@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=william.a.bartlett@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: william.a.bartlett@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:45591] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/00-25018-E78A7825 for ; Sat, 16 Nov 2013 12:16:46 -0500 Received: by mail-ob0-f170.google.com with SMTP id wp18so559251obc.29 for ; Sat, 16 Nov 2013 09:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Q11q11oDX9b9u8MHkS7/TBqG87rwYeE4jgJ+JROiYlw=; b=rVScLC1eVukXup0795WEMbXk+PnXQtdL3xliBfw81dNQI9lZJcr728ZwXZ4PG9HsxC ttEN+esBjPbDRobflwExeCkthTZJfIU/REx2VRDH0q99qKio4567uMTGAh6TeAxpXi5Q azDL8cRVTa9PN/wFmfiJrhyXHnnvdxU84VP3mjWwzb/MKwR2iLeZ6prhHw4WrHcO+QNg yAkMIWHfhYhjTbDE7F+1DtwiraWdpWO7S5Qwo738oKzXkxqN8o2j6pTmYW0mt4XiD1jy Jyo3HoAnBBnf4UXs4+YouE1uCHKJ68ijL7gOU1hXJkqCYUPi9Xe/+sYthudFVbiTC1Kx JxDQ== MIME-Version: 1.0 X-Received: by 10.182.149.168 with SMTP id ub8mr7306939obb.74.1384622203602; Sat, 16 Nov 2013 09:16:43 -0800 (PST) Received: by 10.60.38.230 with HTTP; Sat, 16 Nov 2013 09:16:43 -0800 (PST) In-Reply-To: <52875587.6050000@marc-bennewitz.de> References: <527DF228.1080108@sugarcrm.com> <416659913.20131110035553@cypressintegrated.com> <127298508.20131110042057@cypressintegrated.com> <97776909.20131110045342@cypressintegrated.com> <527FDE61.70102@gmail.com> <346085145.20131110145938@cypressintegrated.com> <52812873.70406@gmail.com> <1755993748.20131111140340@cypressintegrated.com> <52875587.6050000@marc-bennewitz.de> Date: Sat, 16 Nov 2013 12:16:43 -0500 Message-ID: To: Marc Bennewitz Cc: Developers List PHP Mailing Content-Type: multipart/alternative; boundary=001a11348500980c1204eb4e7ac5 Subject: Re: [PHP-DEV] [RFC] Comparison and conversion inconsistency - need more info From: william.a.bartlett@gmail.com (William Bartlett) --001a11348500980c1204eb4e7ac5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Nov 16, 2013 at 6:22 AM, Marc Bennewitz wrot= e: > Hi, > > What about the following PHP logic: > var_dump(null =3D=3D 0); // TRUE > var_dump(null < -1); // TRUE > var_dump(null > -1); // FALSE > > How can you explain that ? > > Greetings > Marc > > false =3D=3Dfalse // TRUE false < true // TRUE false > true // FALSE It's right here: http://www.php.net/manual/en/language.operators.comparison.php. Halfway down the page, type of op 1 is null, op 2 is anything. -- William Bartlett College of Engineering | Cornell University '14 240-432-5189 > Am 15.11.2013 00:03, schrieb Yasuo Ohgaki: > > Hi all, > > > > On Tue, Nov 12, 2013 at 4:03 AM, Sanford Whiteman < > > swhitemanlistens-software@cypressintegrated.com> wrote: > > > >>> You don't have to think the current documentation is awful to find wa= ys > >>> of improving it. > >> > >> Sure, go for it! > > > > > > I wrote my misunderstanding to my personal blog. It seems many people > > misunderstand it, just like me :) > > > > Any improvement/correction? > > min() manual page is better to be updated. I'll add min() example blow = to > > min() manual > > page also. > > > > Index: operators.xml > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- operators.xml (=E3=83=AA=E3=83=93=E3=82=B8=E3=83=A7=E3=83=B3 332115= ) > > +++ operators.xml (=E4=BD=9C=E6=A5=AD=E3=82=B3=E3=83=94=E3=83=BC) > > @@ -1262,7 +1262,7 @@ > > > > bool or null > > anything > > - Convert to bool, &false; < &true; > > + Convert to bool both side, &false; < > > &true; > > > > > > object > > @@ -1298,8 +1298,28 @@ > > > > > > > > + > > > > > > + Boolean/null comparison > > + > > + > + > +// Bool and null are compared as bool always > > +var_dump(1 =3D=3D TRUE); // TRUE - same as (bool)1 =3D=3D TRUE > > +var_dump(0 =3D=3D FALSE); // TRUE - same as (bool)0 =3D=3D FALSE > > +var_dump(100 < TRUE); // FALSE - same as (bool)100 < TRUE > > +var_dump(-10 < FALSE);// FALSE - same as (bool)-10 < FALSE > > +var_dunp(min(-100,-10, NULL, 10, 100); // NULL - (bool)NULL < (bool)-1= 00 > > is FALSE < TRUE > > +?> > > +]]> > > + > > + > > + > > + > > + > > + > > + > > Transcription of standard array comparison > > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11348500980c1204eb4e7ac5--