note 113738 added to reflectionfunction.getclosure
| From: | php dot net-bug at spamhereplease dot com | Date: | Sat, 23 Nov 2013 05:34:35 +0000 |
| Subject: | note 113738 added to reflectionfunction.getclosure | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197624@lists.php.net to get a copy of this message | ||
If you have a callback that is going to be invoked often, you can use this method (and the related
method for ReflectProperty) to get a closure that will execute at near native speed.
Some benchmark comparisons with php 5.4.22 on ubuntu:
[function call] [time] [%slower]
function(): 0.09527 0%
Reflection::Closure: 0.09729 2%
$string(): 0.102641 8%
Reflection: 0.197122 107%
call_user_func: 0.214045 125%
[method call] [time] [% slower] [%vs func]
->method(): 0.103611 0% 9%
Reflection::Closure: 0.1043 1% 9%
$string(): 0.109885 6% 15%
Reflection: 0.20451 97% 115%
call_user_func: 0.219205 112% 130%
----
Server IP: 64.71.164.2
Probable Submitter: 174.52.215.127
----
Manual Page -- http://php.net/manual/en/reflectionfunction.getclosure.php
Edit -- https://master.php.net/note/edit/113738
Del: integrated -- https://master.php.net/note/delete/113738/integrated
Del: useless -- https://master.php.net/note/delete/113738/useless
Del: bad code -- https://master.php.net/note/delete/113738/bad+code
Del: spam -- https://master.php.net/note/delete/113738/spam
Del: non-english -- https://master.php.net/note/delete/113738/non-english
Del: in docs -- https://master.php.net/note/delete/113738/in+docs
Del: other reasons-- https://master.php.net/note/delete/113738
Reject -- https://master.php.net/note/reject/113738
Search -- https://master.php.net/manage/user-notes.php