The php comparison game

Recently, I had a discussion with EnnoBigBenno, one of the friends over at senaeh.de about the merits of php (or lack thereof). I believe that a good and simple programming language can easily be parsed and understood by a human. This brought me to the idea, to create a small game of “True or False” where you have to decide, what the php-interpreter thinks, is true or false. Simple as that. Count your correct answers and check you php-prowess.

Warning: This game is not for the faint of heart. And feel free to share your score in the comments.


1 of 37:
true == false

True or False?
false

2 of 37:
"true" == "false"

True or False?
false

3 of 37:
"true" == false

True or False?
false

4 of 37:
true == "false"

True or False?
true

5 of 37:
"true" == 0

True or False?
true

6 of 37:
"true" + "5" == true

True or False?
true

7 of 37:
"true"*5 == true

True or False?
false

8 of 37:
"true" + "5" == "true"

True or False?
false

9 of 37:
"true" + "5" == "true5"

True or False?
false

10 of 37:
"5" + "true" == "5true"

True or False?
true

11 of 37:
"5foo" == 5

True or False?
true

12 of 37:
"5foo" == "5"

True or False?
false

13 of 37:
"5foo" == "5" + "0"

True or False?
true

14 of 37:
false - true == false

True or False?
false

15 of 37:
"false" == 0

True or False?
true

16 of 37:
"5,5" == 5

True or False?
true

17 of 37:
"5.5" == 5

True or False?
false

18 of 37:
"5 bottles of beer" - true == true

True or False?
true

19 of 37:
"10 bottle of beer" - "5 bottles of beer" == true

True or False?
true

20 of 37:
array() == false

True or False?
true

21 of 37:
array(false) == false

True or False?
false

Now enough with loose comparison. Let’s get on to strict comparison


22 of 37:
5 === round(5.2)

True or False?
false

23 of 37:
5 === round(5)

True or False?
false

24 of 37:
"5" + "2" === 7.0

True or False?
false

25 of 37:
"5.0" + "2" === 7.0

True or False?
true

26 of 37:
(Null + false) === 0

True or False?
true

27 of 37:
(Null & false) === 0

True or False?
true

28 of 37:
(Null && false) === 0

True or False?
false

29 of 37:
"0123" + "0" === 123

True or False?
true

30 of 37:
0123 + "0" === 123

True or False?
false

31 of 37:
array(array()) == array(false)

True or False?
true

32 of 37:
array(1.0 => false) == array("1.0" => false)

True or False?
false

33 of 37:
"0123" == 0123

True or False?
false

34 of 37:
"0x2" == 0x2

True or False?
true

35 of 37:
"0" == "00"

True or False?
true

36 of 37:
"0" == true

True or False?
false

37 of 37:
"00" == true

True or False?
true

So, how well did you do?
36/37 Correct Answers: You are a php genius.
30-35 Correct Answers: You might be the actual php interpreter.
20-30 Correct Answers: You got the gist of php.
10-19 Correct Answers: You might be an actual programmer.
1-9 Correct Answers: You should go back to haskell or lisp. And you know you want to.
0 Correct Answers: You are way beyond hope. I just do not know in which direction.

Share your score in the comments :)

Ein Gedanke zu “The php comparison game

Kommentar verfassen