[wp-trac] [WordPress Trac] #39240: Add a generic return value function

WordPress Trac noreply at wordpress.org
Tue Aug 15 03:15:08 UTC 2017


#39240: Add a generic return value function
-------------------------+----------------------
 Reporter:  fjarrett     |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  General      |     Version:  4.8
 Severity:  normal       |  Resolution:  wontfix
 Keywords:               |     Focuses:
-------------------------+----------------------

Comment (by aurovrata):

 Replying to [comment:3 johnbillion]:
 > This can be achieved without `create_function()` and without magic
 getters or any other type of hack (see
 https://gist.github.com/johnbillion/a5113d0362fb5238742bf773d3da9c4f), but
 I don't think this belongs in core. It's kind of an anti-pattern, and
 makes code hard to debug and unhook when you've got unreferenceable
 callback functions hooked in.

 nice implementation of `__return()`, thank you for sharing!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39240#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list