For example, the following two statements:
call_user_func_array(array($this, 'func'), $param_arr);call_user_func_array(array(&$this, 'func'), $param_arr);
What's the difference between $this and & $this? are objects not all references? In the WordPress hook often see similar to the following statement
add_filter('import_post_meta_key', array($this, 'is_valid_meta_key'));add_filter('http_request_timeout', array(&$this, 'bump_request_timeout'));
Ask for answers ~
Reply content:
For example, the following two statements:
call_user_func_array(array($this, 'func'), $param_arr);call_user_func_array(array(&$this, 'func'), $param_arr);
What's the difference between $this and & $this? are objects not all references? In the WordPress hook often see similar to the following statement
add_filter('import_post_meta_key', array($this, 'is_valid_meta_key'));add_filter('http_request_timeout', array(&$this, 'bump_request_timeout'));
Ask for answers ~
If I understand it correctly, &$this
it is to be compatible with PHP 5.2 and below, if you use the latest PHP should be equivalent.
PHP Reference Pass, read this article to understand the http://m.baidu.com/from=1269a/bd_page_type=1/ssid=0/uid=0/pu=usm%400%2Csz%401320_1001%2Cta% 40iphone_2_4.1_3_537/baiduid=0af2f0c34034dd7478809f025903d4fa/w=0_10_php%e5%bc%95%e7%94%a8%e4%bc%a0%e9%80%92/t =iphone/l=3/tc?ref=www_iphone&lid=8973481160499757776&order=1&vit=osres&tj=www_normal_1_0_10 &m=8&srd=1&cltj=cloud_title&dict=20&fm=wnor&sec=43095&di=46cc7fb35bcae0a5& Bdenc=1&nsrc=ilpt2aeptyoa_yixcfoxxnanedt62v3ieqgg_ytk1dk6mlrte4vizqrasddmx7injvgwdos4csxnat0u3mru7xj_ R0dmpwkbznupdprhgk3ahrmofqnknnbwvs7