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.
No comments yet.
Leave a comment
Most Popular Posts
Most Recent
- RockMelt Browser – Future of Browsers?
- Adding Syntax Highlighting – Yay!
- PHP Tip: Handling Form Data
- Q&A: Which Framework Should I Use?
- Make an Impact
- Someone Failed to Inform Me
- Modrewrite and Short Urls – What you really want to know.
- Professional PHP
- Google Speaks on Net Neutrality and Benefits of caching
- Screen Scraping made too easy
Categories
- Computers (4)
- JavaScript (1)
- MySQL (3)
- Personal Life (4)
- PHP (9)
- Software Development (6)
- Technology (3)
- Tips (5)
- Tutorials (1)
- Uncategorized (3)
- Web Development (10)
- Work Life (1)