{"id":87,"date":"2023-06-05T12:56:56","date_gmt":"2023-06-05T04:56:56","guid":{"rendered":"http:\/\/pro369.com\/php\/?p=87"},"modified":"2019-04-16T16:21:56","modified_gmt":"2019-04-16T16:21:56","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e5%bb%b6%e4%bc%b8%e8%a3%a1%e5%91%bc%e5%8f%abphp%e5%87%bd%e6%95%b8","status":"publish","type":"post","link":"https:\/\/por.tw\/php\/%e5%a6%82%e4%bd%95%e5%9c%a8%e5%bb%b6%e4%bc%b8%e8%a3%a1%e5%91%bc%e5%8f%abphp%e5%87%bd%e6%95%b8\/","title":{"rendered":"\u5982\u4f55\u5728\u5ef6\u4f38\u88e1\u547c\u53ebPHP\u51fd\u6578"},"content":{"rendered":"<p><strong><font color=\"#800080\">\u8981\u5982\u4f55\u5728\u5ef6\u4f38\u88e1\u547c\u53ebPHP\u51fd\u6578\u5462?\u5728\u5beb\u5ef6\u4f38\u7684\u6642\u5019\uff0c\u80af\u5b9a\u4e0d\u80fd\u4ec0\u9ebc\u529f\u80fd\u90fd\u81ea\u5df1\u5be6\u73fe\uff0c\u539f\u56e0\u6709\u5f88\u591a\uff0c\u958b\u767c\u6548\u7387\u3001\u6548\u80fd\u554f\u984c\u3001\u7dad\u8b77\u6210\u672c\u7b49\u3002<\/font><\/p>\n<p> <font color=\"#008000\">\u9019\u5c31\u907f\u514d\u4e0d\u4e86\u8981\u5728\u5ef6\u4f38\u88e1\u547c\u53ebPHP\u5167\u6838\u51fd\u6578\u3002<\/font><br \/> <font color=\"#FF00FF\"><br \/> \u90a3\u9ebc\u5982\u4f55\u5728\u5ef6\u4f38\u88e1\u9762\u4f7f\u7528\u6211\u5011\u7684\u5167\u5efa\u51fd\u6578\u5462\uff1f<\/font><\/p>\n<p> <font color=\"#0000FF\">PHP\u65e2\u7136\u6709\u51fd\u6578\uff0c\u80af\u5b9a\u63d0\u4f9b\u4e86\u547c\u53eb\u51fd\u6578\u7684\u4ecb\u9762\uff0c<\/font><\/p>\n<p> <font color=\"#800000\">\u9019\u88e1\u6709\u5169\u500b\u51fd\u6578\uff1a<\/font><\/strong><\/p>\n<p> ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC);<\/p>\n<p> ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, zend_uint param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC);<\/p>\n<p> \u5f88\u53ef\u60dc\uff0c\u53ea\u627e\u5230\u8072\u660e\u7684\u5730\u65b9\uff0c\u6c92\u6709\u627e\u5230\u8a3b\u91cb\u7684\u5730\u65b9\uff0c<\/p>\n<p> \u5f9e\u8072\u660e\u4f86\u770b\uff0ccall_user_function \u5c01\u88dd\u4e86call_user_function_ex\uff0c<\/p>\n<p> \u5c11\u4e86\u5169\u500b\u50b3\u53c3\uff1a<\/p>\n<p> int no_separation\uff1a\u9019\u500b\u7684\u7528\u610f\u5c31\u662f\u662f\u5426\u5c0dzval\u9032\u884c\u5206\u96e2\uff0c\u4e0d\u904e\u6b64\u529f\u80fd\u73fe\u5728\u5df2\u7d93\u4e0d\u7528\u4e86\uff0c\u5982\u679c\u8a2d\u70ba1\u5247\u76f4\u63a5\u6703\u51fa\u932f\uff0c\u5206\u96e2\u7684\u4f5c\u7528\u662f\u70ba\u4e86\u6539\u5584\u7a7a\u9593\u3002<\/p>\n<p> symbol_table \uff1a\u662f\u5e79\u55ce\u7528\u7684\uff0c\u78ba\u5be6\u76ee\u524d\u9084\u4e0d\u77e5\u9053\u3002<\/p>\n<p> HashTable* function_table\uff1a \u51fd\u6578\u8868\uff0c\u6211\u5011\u90fd\u77e5\u9053 \u4f7f\u7528\u8005\u51fd\u6578\u4e5f\u597d\uff0c\u5176\u4ed6\u5167\u5efa\u51fd\u6578\u4e5f\u597d\u90fd\u6703\u5b58\u5728hashtable\u88e1\u9762\uff0cfunction_table\u6703\u5132\u5b58\u6240\u6709\u5167\u5efa\u51fd\u6578\u548c\u4f7f\u7528\u8005\u51fd\u6578\uff0c\u7528CG\u4f86\u53d6\u5f97\uff0c\u56e0\u70ba\u51fd\u6578\u8868\u5c6c\u65bc\u662f \u7de8\u8b6f\u5168\u5c40\u8b8a\u91cf\u3002<\/p>\n<p> zval **object_pp:\u9019\u500b\u662f\u7528\u4f86\u6211\u5011\u547c\u53eb\u985e\u88e1\u7684\u67d0\u500b\u65b9\u6cd5\u7684\u5c0d\u8c61\uff0c\u770b\u5230\u9019\u88e1\uff0c\u4f60\u604d\u7136\u5927\u609f\u6c92\u6709\uff0c\u547c\u53eb\u666e\u901a\u51fd\u6578\u548c\u547c\u53eb\u985e\u7684\u65b9\u6cd5\u662f\u540c\u4e00\u500b\uff0c<br \/> function_table\u548cobject_pp\u53ea\u9700\u8981\u4e00\u500b\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p> zval **retval_ptr_ptr\uff1a\u662f\u51fd\u6578\u7684\u8fd4\u56de\u503c\u3002<\/p>\n<p> zend_uint param_count\uff1a\u51fd\u6578\/\u65b9\u6cd5 \u7684\u53c3\u6578\u500b\u6578<\/p>\n<p> zval **params[] \uff1a\u51fd\u6578\/\u65b9\u6cd5\u7684\u53c3\u6578\u6307\u6a19\u3002<\/p>\n<p> \u90a3\u9ebc\u6e05\u695a\u4e86\u5169\u500bAPI\u7684\u53c3\u6578\u53ca\u547c\u53eb\u65b9\u6cd5\u4e4b\u5f8c\uff0c\u6211\u5011\u4f86\u6e2c\u8a66\u4e00\u4e0b\uff0c\u7a76\u7adf\u5982\u4f55\u4f86\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u5982\u4f55\u5728\u5ef6\u4f38\u88e1\u547c\u53ebPHP\u51fd\u6578\u5462?\u5728\u5beb\u5ef6\u4f38\u7684\u6642\u5019\uff0c\u80af\u5b9a\u4e0d\u80fd\u4ec0\u9ebc\u529f\u80fd\u90fd\u81ea\u5df1\u5be6\u73fe\uff0c\u539f\u56e0\u6709\u5f88\u591a\uff0c\u958b\u767c\u6548\u7387\u3001\u6548\u80fd\u554f\u984c\u3001\u7dad [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":400,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[22],"class_list":["post-87","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/87"}],"collection":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media\/400"}],"wp:attachment":[{"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/php\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}