Dave Hall Consulting logo

PHP on crack

I had a chuckle while reading Ed Finkler's PHP6 wish list. After reading the comment by Damien Seguy I almost fell off my chair.

Try running the following code under PHP

<?php ${'[email protected]#$%^&*()[]:;"<>,./?'} = "i bet this won't work!<br>\n"; ${"omg???!!! wtf???!!! :D"} = "omg it does<br>\n"; echo ${'[email protected]#$%^&*()[]:;"<>,./?'} . ${"omg???!!! wtf???!!! :D"};

It worked here on PHP 5.2.3 with ubuntu security fixes. I got

i bet this won't work!<br>
omg it does<br>

This contradicts the PHP manual, but hey it works.