Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9320

Re: Booleans compared to strings

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <1474783.kRIWQ1k3cJ@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Tue, 14 May 2013 00:41:31 +0200
User-Agent KNode/4.10.2
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: Booleans compared to strings
Newsgroups comp.lang.php
References <b292b42b-16ed-40bc-b005-79970a9e6362@googlegroups.com> <kmqom5$q5m$1@dont-email.me> <2bd61219-9d95-458a-938c-24938fa4ab59@googlegroups.com> <avd3s5Fdr9lU1@mid.uni-berlin.de> <18508838.qTh01YhHoi@PointedEars.de> <kmrpf7$ejd$2@news.albasani.net>
MIME-Version 1.0
Lines 37
NNTP-Posting-Date 14 May 2013 00:41:31 CEST
NNTP-Posting-Host 1116f756.newsspool3.arcor-online.net
X-Trace DXC=^5JY>nonDeofF8a^:6>b7eMcF=Q^Z^V3h4Fo<]lROoRa8kF<OcfhCOka`:6Ko^Zg`lDZm8W4\YJNlb@mF9jNikdeBoKGPB=12Agk56K4D^\Xae
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.php:9320

Show key headers only | View raw


The Natural Philosopher wrote:

> On 13/05/13 22:46, Thomas 'PointedEars' Lahn wrote:
>> M. Strobel wrote:
>>> Am 13.05.2013 22:24, schrieb Doug Cassidy:
>>>> On Monday, May 13, 2013 6:13:11 AM UTC-7, Jerry Stuckle wrote:
>>>>> On 5/13/2013 8:29 AM, Doug Cassidy wrote:
>>>>>> I dont see why boolean true is equal to string false in any way.
>>>>> A string comparison returns false only if the string is NULL, is an
>>>>> empty string ('') or contains a zero ('0').  All other values
>>>>> (including 'false') are true.
>>>> got it, thanks
>>> My favourite link to comparison in PHP is
>>> http://www.php.net/manual/en/types.comparisons.php
>>> where you have also the "if ($x)" results.
>>>
>>> Highly recommended.
>> Slighty off, though, because “if” is _not_ a function.
> Semantics. It behaves like one, takes two variables and returns a value.

I am not usually reading your postings because of your notorious address 
munging and anonymous posting, but really …

What the *heck* are you talking about?  An “if” *statement* does not return 
anything (in neither programming language where it is a statement), and it 
does not “take two variables”.  It is the *one* “parameter” (for lack of a 
better word) to the statement that is evaluated to a value, which is then 
converted to boolean, which then determines whether or not the adjacent 
statement is executed.


PointedEars 
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Booleans compared to strings Doug Cassidy <doug@dougcassidy.com> - 2013-05-13 05:29 -0700
  Re: Booleans compared to strings Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 09:13 -0400
    Re: Booleans compared to strings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 17:22 +0200
    Re: Booleans compared to strings Doug Cassidy <doug@dougcassidy.com> - 2013-05-13 13:24 -0700
      Re: Booleans compared to strings "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-05-13 23:22 +0200
        Re: Booleans compared to strings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 23:46 +0200
          Re: Booleans compared to strings The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:28 +0100
            Re: Booleans compared to strings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-14 00:41 +0200
            Re: Booleans compared to strings Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 18:56 -0400
            Re: Booleans compared to strings "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-05-14 21:36 +0200
              Re: Booleans compared to strings The Natural Philosopher <tnp@invalid.invalid> - 2013-05-14 21:17 +0100
                Re: Booleans compared to strings "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-05-15 21:34 +0200
        Re: Booleans compared to strings The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:26 +0100
          Re: Booleans compared to strings Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-13 18:57 -0400
  Re: Booleans compared to strings Robert Heller <heller@deepsoft.com> - 2013-05-13 08:57 -0500
    Re: Booleans compared to strings Doug Cassidy <doug@dougcassidy.com> - 2013-05-13 13:23 -0700
  Re: Booleans compared to strings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-13 17:18 +0200
    Re: Booleans compared to strings The Natural Philosopher <tnp@invalid.invalid> - 2013-05-13 23:21 +0100

csiph-web