[wp-trac] [WordPress Trac] #10493: Allow closures as callbacks

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 5 21:44:24 UTC 2010


#10493: Allow closures as callbacks
-------------------------+--------------------------------------------------
 Reporter:  scribu       |       Owner:  scribu        
     Type:  enhancement  |      Status:  new           
 Priority:  normal       |   Milestone:  Future Release
Component:  General      |     Version:  2.9           
 Severity:  normal       |    Keywords:  has-patch     
-------------------------+--------------------------------------------------
Changes (by hakre):

  * milestone:  3.0 => Future Release


Comment:

 Quite a theoretic discussion this is, right? First of all what's said is
 that the callback pseudo-type PHP has does handle lambda functions (which
 is just the [http://www.php.net/manual/en/language.pseudo-
 types.php#language.types.callback standard PHP behaviour as documented]:
 ''"As of PHP 5.3.0 it is possible to also pass a
 [http://www.php.net/manual/en/functions.anonymous.php closure] to a
 callback parameter"''). That just for the log.

 Next to the fact that this wordpress enhancement which just is an existing
 PHP feature (we do not need to patch anything, this will work out of the
 box), you should keep in mind that you need PHP version 5.3 or higher for
 it. Unless the system requirements do not call for that PHP version (WP
 core is far away from that), suggesting to use it is just wrong, it will
 actually defect exsiting code in case core code is changed based on this
 tickets suggestion.

 I suggest to close this ticket as invalid. I'll add it to the
 [http://codex.wordpress.org/User:Hakre/PHP5-List PHP 5 list on my codex
 pages] so it does not get lost.

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


More information about the wp-trac mailing list