Wednesday, August 30. 2006A mostly unknown perhaps useless but sorta neat PHP coding trickTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
It gets way better:
$a = array(1, 2, 3, 4, 4 => 'beer'); echo "I want {$a["{$a["{$a["{$a["{$a[0]}"]}"]}"]}"]}!\n" Comment (1)
Never have I been se grateful that a feature was not published. You can only imagine what "uses" the folks over at strrev('bbphp') would have found for this "feature"
Comments (2)
This is actually a fairly good feature. It's called variable variables (http://www.php.net/manual/en/language.variables.variable.php). So the feature is actually quite documented and there is valid usage for this.
Comment (1)
I think you are missing the point. I, for one, had no idea that you could call functions directly from a string.
$ab = '6'; echo "ab: {${exit}}"; Just another way to call eval(), I guess. And actually that's exactly what it is: echo "ab: {${;}}"; Parse error: parse error, unexpected ';' in xx : eval()'d code on line x; Comments (2)
|
Static PagesLinks mentioned in this articleCalendar
Blog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||