OK! A little game for you all
The only objective is to switch the values of
$a and
$b. The values of
$a and
$b are 1 and 2, respectively:
So for example this is an easy way to do it:
However! We're not looking for the simplest way to do it, or the fastest, but rather, the most inventive way to do it! There are a couple of rules and those are:
-
eval and create_function functions are disallowed.
- 8 lines maximum but lines with only
{ and } on do not count towards that total. This does not include the 2 initial assignments of $a and $b, or any echoes of the values $a or $b.
- You must have only one semi-colon per line (
;) unless of course it's used elsewhere apart from indicating the end of a line. Thus you're not allowed to fuse 2 lines together into 1. The exception is a for loop to where you're allowed 2.
So basically
$a must equal 2 and
$b must equal 1 at the end of your code.
I'll start us off:
Put that mind to work! Oh, and just for Karl, you can't just set
$a to 2 and
$b to 1

You have to reference the first 2 variables set!