I Won a Bet With This

Apparently you can't create variables that start with a number in PHP.
Well I made it happen.

Try it:

$foutytwo = 42;
var_dump($fortytwo);
echo ${$fortytwo} = 'fortytwo';
?>

And just to make sure that you really did create a variable with the name of '42', add this to the end:

print_r(get_defined_vars());

And somewhere near the bottom of the list, you'll see it. :)

Friday, September 28th, 2007 Uncategorized

No comments yet.

Leave a comment