You know you've done too much PHP when...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

You know you've done too much PHP when...

Post by impulse() »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Very cute.
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Post by php3ch0 »

lol

I like
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Nice! :lol:
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

Code: Select all

class killnoob implements ChineseKungfu{
  function __CONSTRUCT(){
    global $noob;
    die($noob);
    //SUCCESS on killing all the noobs in the world.
  }
}
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

Why does 2^2 = 0 in php?
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

'^' is XOR.

Truth table for XOR:

Code: Select all

0 ^ 0 | 0
0 ^ 1 | 1
1 ^ 0 | 1
1 ^ 1 | 0
When PHP sees the "2 ^ 2" it interprets it like: 10 ^ 10 (2 in dec = 10 in binary)
And it does the arithmetic XOR operation bit by bit:

Code: Select all

10
XOR
	10
=============
	00
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

Well I've never had to do anything but addition, subtraction, multiplication, and division in php, so I didn't know that.
User avatar
ptrpan
Forum Commoner
Posts: 81
Joined: Tue Apr 03, 2007 5:09 am
Location: Cape Town, South Africa

Post by ptrpan »

hahahaha. Couldnt be more true :lol:
Post Reply