[wp-hackers] Passing class methods by reference

Michael D Adams mda at blogwaffe.com
Fri Aug 6 21:29:24 UTC 2010


On Fri, Aug 6, 2010 at 2:25 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> On Aug 6, 2010, at 5:20 PM, Michael D Adams wrote:
>> Sorry - I meant compared to straight functions.  The context (in my head) was
>>
>> $object_i_can_use = My_Class::instance();
>> vs.
>> $object_i_can_use() = my_class_instance();
>>
>> Where the former stores the as a static property or variable, and the
>> later accesses a previously created global.
>>
>> I didn't actually benchmark that specific scenario, though, so I
>> probably shouldn't even have mentioned it :)
>
> I guess the important question is, is the performance different significant enough to matter in the context of WordPress plugins?

I doubt it. (But there I go again saying things without benchmarking them.)


More information about the wp-hackers mailing list