RSS feed blog feed : : del.icio.us : : newsletter : : free magazines : : find a job

Logical Operators for PHP, VBScript, Javascript

Posted by Ken Cheung on Tuesday, May 9, 2006 in General : : comment

In the past, I have worked with javascript, asp/vbscript, coldfusion, and a little bit of perl. Now, I've started working with php. I have to admit, it can get confusing at times (especially if you have to keep going back and forth between them). So, I decided I'm going to start putting together comparison charts for javascript, vbscript, and php (maybe perl and coldfusion down the road, but for now just the three scripting languages). My first chart will be for logical operators.

operator vbscript javascript php
AND and && and
&&
OR or || or
||
not NOT ! !
XOR xor xor

Operator Precedence:

  • vbscript:     not     and     or     xor
  • javascript:     !     &&     ||
  • php:     !     &&     ||     and     xor     or

VBScript and Null:

  • null and true = null
  • null and false = false
  • null and null = null
  • null or true = true
  • null or false = null
  • null or null = null
  • not null = null
  • null xor true = null
  • null xor false = null
  • null xor null = null

References:

If you found this page interesting, bookmark and share it on:
del.icio.us : : digg : : yahoo : : furl : : reddit : : newsvine : : spurl : : blink : : simpy : : blogmarks

Posts of Interest

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

iZachy Newsletter

Don't have time to visit iZachy everyday? Then sign up for my free newsletter. I'll send you an email when I have something to share with you. Your email address will be kept confidential and I will not share, sell, or rent it to anyone. You can unsubscribe at any time by clicking a link in the email.

Enter your email address to sign up for my newsletter: