[wp-trac] [WordPress Trac] #12209: Syntax errors in filters

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 12 03:50:23 UTC 2010


#12209: Syntax errors in filters
----------------------------+-----------------------------------------------
 Reporter:  mfields         |       Owner:                          
     Type:  defect (bug)    |      Status:  new                     
 Priority:  normal          |   Milestone:                          
Component:  Administration  |     Version:                          
 Severity:  normal          |    Keywords:  filter, variable, syntax
----------------------------+-----------------------------------------------
Changes (by nacin):

  * milestone:  Unassigned =>


Comment:

 It looks weird, but it works. It's a way to define a variable variable.

 {{{
 $foo = 'bar';
 $baz = "${foo}";
 var_dump( $baz ); // string(3) "bar"
 $baz = "{$foo}";
 var_dump( $baz ); // string(3) "bar"
 }}}

 Based on a real quick test, it appears to be a negligible difference in
 performance.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12209#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list