Jump to content


Photo

difference between !== and ==!


  • This topic is locked This topic is locked
10 replies to this topic

#1 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 06 October 2006 - 05:06 PM

i dont get it. :x

#2 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 06 October 2006 - 05:30 PM

=== or !== is a strict comparison....to compare both the value AND the variable type

== or != is a basic comparison....to compare just the value


for instance

var_dump(false == 0); //displays true
var_dump(false !=== 0); //displays false

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#3 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 06 October 2006 - 07:20 PM

i didnt ask the difference between !== and !=...

i asked the difference between !== and ==!... lol.

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 06 October 2006 - 07:24 PM

i didnt ask the difference between !== and !=...

i asked the difference between !== and ==!... lol.


well, !== is explained above, and ==! isn't a PHP operator at all
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 06 October 2006 - 07:58 PM

but i used it before and it worked as if i was using !== :/

#6 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 07 October 2006 - 06:02 PM

lol??

#7 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 07 October 2006 - 06:37 PM

i cant think of any reason why you'd need to use ==! as the whole logic of it is a little mindblowing.

this would mean $a not equal to $b:
$a!==$b

this would mean $a equal to not $b. so if $b is set, or true, !$b = false . if $b not set or is false, $!b = true
$a==!$b
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 07 October 2006 - 06:40 PM

that is madness man what the hel is that ==!

incorrect read the above information there is not a operator like that in the world for php you might of used it but it's not doing nothink wast of code.

your making your own php code up lol

who in there right mind would say this example

a equal not b what?
$a==!b;

you blow my mind lol...................

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 07 October 2006 - 07:06 PM

lol if it works and doesnt throw an error, then technically its perfectly valid syntax...i even (sadly) went and had a play around with it. i can safely say that it'll never end up in anything i ever do :)
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#10 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 07 October 2006 - 10:00 PM

lmfao. it worked fine for me rofl.

#11 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 08 October 2006 - 12:03 AM

Hmm... I think this is about done.

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users