{"id":1246,"date":"2026-01-06T15:52:16","date_gmt":"2026-01-06T07:52:16","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=1246"},"modified":"2026-01-06T15:52:16","modified_gmt":"2026-01-06T07:52:16","slug":"%e8%af%a6%e8%a7%a3php%e4%b8%ad%e4%ba%92%e6%96%a5%e9%94%81%e5%ba%93hyperf-wise-locksmith%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2026\/01\/06\/%e8%af%a6%e8%a7%a3php%e4%b8%ad%e4%ba%92%e6%96%a5%e9%94%81%e5%ba%93hyperf-wise-locksmith%e7%9a%84%e4%bd%bf%e7%94%a8\/","title":{"rendered":"\u8be6\u89e3PHP\u4e2d\u4e92\u65a5\u9501\u5e93hyperf-wise-locksmith\u7684\u4f7f\u7528"},"content":{"rendered":"\n<p>\u4e0b\u9762\u6211\u7528**\u300c\u662f\u4ec0\u4e48 \u2192 \u80fd\u505a\u4ec0\u4e48 \u2192 \u600e\u4e48\u7528 \u2192 \u5178\u578b\u573a\u666f \u2192 \u6ce8\u610f\u4e8b\u9879\u300d**\u7684\u7ed3\u6784\uff0c<strong>\u7cfb\u7edf\u3001\u5b9e\u6218\u5316<\/strong>\u5730\u7ed9\u4f60\u8be6\u89e3<br>\ud83d\udc49 <strong>PHP \u4e92\u65a5\u9501\u5e93\uff1a<code>hyperf-wise-locksmith<\/code><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001hyperf-wise-locksmith \u662f\u4ec0\u4e48\uff1f<\/h2>\n\n\n\n<p><strong>hyperf-wise-locksmith<\/strong> \u662f Hyperf \u751f\u6001\u4e2d\u4e00\u4e2a<strong>\u7edf\u4e00\u7684\u5206\u5e03\u5f0f\u4e92\u65a5\u9501\uff08Mutex Lock\uff09\u62bd\u8c61\u5e93<\/strong>\uff0c\u6838\u5fc3\u76ee\u6807\u662f\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\u7528\u540c\u4e00\u5957 API\uff0c\u5b89\u5168\u5730\u64cd\u4f5c\u4e0d\u540c\u540e\u7aef\u7684\u9501\uff08Redis \/ MySQL \/ \u6587\u4ef6 \/ \u5185\u5b58\uff09<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>\u5b83\u672c\u8d28\u4e0a\u89e3\u51b3\u7684\u662f <strong>\u9ad8\u5e76\u53d1\u4e0b\u7684\u8d44\u6e90\u7ade\u4e89\u95ee\u9898<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9632\u6b62<strong>\u91cd\u590d\u6267\u884c<\/strong><\/li>\n\n\n\n<li>\u9632\u6b62<strong>\u8d85\u5356 \/ \u91cd\u590d\u6263\u51cf<\/strong><\/li>\n\n\n\n<li>\u9632\u6b62<strong>\u5e76\u53d1\u5199\u51b2\u7a81<\/strong><\/li>\n\n\n\n<li>\u9632\u6b62<strong>\u5b9a\u65f6\u4efb\u52a1\u91cd\u53e0\u6267\u884c<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u5b83\u80fd\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5178\u578b\u75db\u70b9\uff08\u4f60\u4e00\u5b9a\u9047\u5230\u8fc7\uff09<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u573a\u666f<\/th><th>\u95ee\u9898<\/th><\/tr><\/thead><tbody><tr><td>\u79d2\u6740 \/ \u62a2\u8d2d<\/td><td>\u591a\u4e2a\u8bf7\u6c42\u540c\u65f6\u6263\u5e93\u5b58<\/td><\/tr><tr><td>\u5b9a\u65f6\u4efb\u52a1<\/td><td>cron \u591a\u5b9e\u4f8b\u540c\u65f6\u8dd1<\/td><\/tr><tr><td>\u6d88\u606f\u6d88\u8d39<\/td><td>\u540c\u4e00\u6d88\u606f\u88ab\u591a\u6b21\u5904\u7406<\/td><\/tr><tr><td>\u63a5\u53e3\u5e42\u7b49<\/td><td>\u91cd\u590d\u63d0\u4ea4\u8ba2\u5355<\/td><\/tr><tr><td>\u5206\u5e03\u5f0f\u73af\u5883<\/td><td>\u5355\u673a\u9501\uff08flock\uff09\u5931\u6548<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>wise-locksmith = \u5206\u5e03\u5f0f\u5b89\u5168\u9501<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u652f\u6301\u7684\u9501\u9a71\u52a8\uff08\u975e\u5e38\u5173\u952e\uff09<\/h2>\n\n\n\n<p>hyperf-wise-locksmith \u5e76\u4e0d\u76f4\u63a5\u5b9e\u73b0\u9501<br>\ud83d\udc49 <strong>\u5b83\u662f\u4e00\u4e2a\u300c\u9501\u8c03\u5ea6\u5668\u300d<\/strong><\/p>\n\n\n\n<p>\u5e38\u89c1\u9a71\u52a8\u5305\u62ec\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9a71\u52a8<\/th><th>\u8bf4\u660e<\/th><\/tr><\/thead><tbody><tr><td>Redis<\/td><td>\u6700\u5e38\u7528\uff08\u63a8\u8350\uff09<\/td><\/tr><tr><td>MySQL<\/td><td>\u9002\u5408\u65e0 Redis \u73af\u5883<\/td><\/tr><tr><td>\u6587\u4ef6\u9501<\/td><td>\u5355\u673a\u8c03\u8bd5<\/td><\/tr><tr><td>\u5185\u5b58\u9501<\/td><td>\u5355\u8fdb\u7a0b\u6d4b\u8bd5<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u5b89\u88c5\u65b9\u5f0f<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncomposer require hyperf\/wise-locksmith\n\n<\/pre><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u524d\u63d0\uff1a\u4f60\u5728 <strong>Hyperf \u6846\u67b6<\/strong>\u4e2d\u4f7f\u7528<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u6838\u5fc3\u6982\u5ff5\uff08\u4e00\u5b9a\u8981\u7406\u89e3\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 Lock\uff08\u9501\u5bf9\u8c61\uff09<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8868\u793a\u4e00\u4e2a<strong>\u4e92\u65a5\u8d44\u6e90<\/strong><\/li>\n\n\n\n<li>\u901a\u8fc7 <strong>\u552f\u4e00 key<\/strong> \u6807\u8bc6<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$orderLock = $lockFactory-&gt;create(&#039;order:123&#039;);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 LockFactory\uff08\u9501\u5de5\u5382\uff09<\/h3>\n\n\n\n<p>\u7edf\u4e00\u521b\u5efa\u9501\u5b9e\u4f8b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nuse Hyperf\\WiseLocksmith\\LockFactory;\n\npublic function __construct(\n    private LockFactory $lockFactory\n) {}\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3\ufe0f\u20e3 \u9501\u7684\u751f\u547d\u5468\u671f<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u83b7\u53d6\u9501 \u2192 \u6267\u884c\u4e1a\u52a1 \u2192 \u91ca\u653e\u9501\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u6700\u57fa\u7840\u7528\u6cd5\uff08\u5f3a\u70c8\u5efa\u8bae\u8fd9\u6837\u5199\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u9632\u6b62\u8ba2\u5355\u91cd\u590d\u5904\u7406<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$lock = $this-&gt;lockFactory-&gt;create(&#039;order:&#039;.$orderId);\n\nif ($lock-&gt;acquire()) {\n    try {\n        \/\/ \u4e1a\u52a1\u903b\u8f91\n        $this-&gt;processOrder($orderId);\n    } finally {\n        $lock-&gt;release();\n    }\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u4e3a\u4ec0\u4e48\u4e00\u5b9a\u8981 <code>try...finally<\/code>\uff1f<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9632\u6b62\u5f02\u5e38\u5bfc\u81f4<strong>\u6b7b\u9501<\/strong><\/li>\n\n\n\n<li>finally \u6c38\u8fdc\u4f1a\u6267\u884c<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u5e26\u8d85\u65f6\u7684\u9501\uff08\u751f\u4ea7\u5fc5\u7528\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u83b7\u53d6\u9501\u8d85\u65f6\u65f6\u95f4<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$lock = $this-&gt;lockFactory-&gt;create(\n    &#039;order:&#039;.$orderId,\n    5 \/\/ \u9501\u8fc7\u671f\u65f6\u95f4\uff08\u79d2\uff09\n);\n\n<\/pre><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u907f\u514d\u670d\u52a1\u5b95\u673a\u540e\u9501\u6c38\u8fdc\u4e0d\u91ca\u653e<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u963b\u585e\u7b49\u5f85\u9501\uff08\u53ef\u9009\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$lock-&gt;acquire(3); \/\/ \u6700\u591a\u7b49\u5f85 3 \u79d2\n\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7ed3\u679c<\/th><th>\u542b\u4e49<\/th><\/tr><\/thead><tbody><tr><td>true<\/td><td>\u6210\u529f\u62ff\u5230\u9501<\/td><\/tr><tr><td>false<\/td><td>\u7b49\u5f85\u8d85\u65f6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u6700\u63a8\u8350\u7684\u5199\u6cd5\uff1awithLock\uff08\u8bed\u4e49\u6700\u6e05\u6670\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$this-&gt;lockFactory-&gt;create(&#039;pay:&#039;.$orderId, 5)\n    -&gt;withLock(function () use ($orderId) {\n        $this-&gt;pay($orderId);\n    });\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u4f18\u70b9<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52a8 acquire + release<\/li>\n\n\n\n<li>\u4e0d\u5bb9\u6613\u5199\u9519<\/li>\n\n\n\n<li>\u4ee3\u7801\u66f4\u5e72\u51c0<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001Redis \u5206\u5e03\u5f0f\u9501\u539f\u7406\uff08\u4f60\u8981\u61c2\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5185\u90e8\u505a\u4e86\u4ec0\u4e48\uff1f<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>SET key value NX EX ttl<\/code><\/li>\n\n\n\n<li>value \u662f\u552f\u4e00\u6807\u8bc6\uff08\u9632\u6b62\u8bef\u5220\uff09<\/li>\n\n\n\n<li>\u91ca\u653e\u65f6\u6821\u9a8c value<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 <strong>\u8fd9\u662f\u5b89\u5168\u7248\u7684 Redis \u9501\uff0c\u4e0d\u662f naive \u5b9e\u73b0<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u5178\u578b\u5b9e\u6218\u573a\u666f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u573a\u666f 1\uff1a\u5e93\u5b58\u6263\u51cf\uff08\u9632\u8d85\u5356\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$this-&gt;lockFactory-&gt;create(&#039;stock:&#039;.$skuId, 3)\n    -&gt;withLock(function () use ($skuId) {\n        $stock = $this-&gt;stockDao-&gt;get($skuId);\n        if ($stock &amp;lt;= 0) {\n            throw new BusinessException(&#039;\u5e93\u5b58\u4e0d\u8db3&#039;);\n        }\n        $this-&gt;stockDao-&gt;decrement($skuId);\n    });\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u573a\u666f 2\uff1a\u5b9a\u65f6\u4efb\u52a1\u9632\u91cd\u5165<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$this-&gt;lockFactory-&gt;create(&#039;cron:sync_user&#039;, 60)\n    -&gt;withLock(function () {\n        $this-&gt;syncUser();\n    });\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u573a\u666f 3\uff1a\u63a5\u53e3\u5e42\u7b49<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$key = &#039;idempotent:&#039; . $requestId;\n\nif (! $this-&gt;lockFactory-&gt;create($key, 10)-&gt;acquire()) {\n    throw new RepeatRequestException();\n}\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u5e38\u89c1\u5751\uff08\u4e00\u5b9a\u8981\u770b\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c \u9501 key \u4e0d\u552f\u4e00<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ \u9519\u8bef\ncreate(&#039;order&#039;);\n\n\/\/ \u6b63\u786e\ncreate(&#039;order:&#039; . $orderId);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c \u9501\u65f6\u95f4\u592a\u77ed<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e1a\u52a1\u672a\u5b8c\u6210<\/li>\n\n\n\n<li>\u9501\u63d0\u524d\u5931\u6548<\/li>\n\n\n\n<li><strong>\u5e76\u53d1\u7a7f\u900f<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 TTL \u2265 \u4e1a\u52a1\u6700\u957f\u6267\u884c\u65f6\u95f4<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u274c \u4e0d\u91ca\u653e\u9501<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6ca1\u6709 try-finally<\/li>\n\n\n\n<li>\u5f02\u5e38\u76f4\u63a5 return<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e8c\u3001\u548c\u4f60\u53ef\u80fd\u7528\u8fc7\u7684\u9501\u5bf9\u6bd4<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u65b9\u6848<\/th><th>\u95ee\u9898<\/th><\/tr><\/thead><tbody><tr><td>flock<\/td><td>\u53ea\u80fd\u5355\u673a<\/td><\/tr><tr><td>Redis \u624b\u5199\u9501<\/td><td>\u5bb9\u6613\u5199\u9519<\/td><\/tr><tr><td>MySQL for update<\/td><td>\u6027\u80fd\u5dee<\/td><\/tr><tr><td>wise-locksmith<\/td><td><strong>\u7edf\u4e00\u3001\u5b89\u5168\u3001\u89c4\u8303<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e09\u3001\u9002\u5408\u4f60\u5417\uff1f<\/h2>\n\n\n\n<p>\u2705 \u975e\u5e38\u9002\u5408\u4f60\u5982\u679c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hyperf \u9879\u76ee<\/li>\n\n\n\n<li>\u9ad8\u5e76\u53d1\u63a5\u53e3<\/li>\n\n\n\n<li>\u591a\u5b9e\u4f8b\u90e8\u7f72<\/li>\n\n\n\n<li>\u5206\u5e03\u5f0f\u4efb\u52a1 \/ MQ<\/li>\n<\/ul>\n\n\n\n<p>\u274c \u4e0d\u9002\u5408\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5355\u811a\u672c PHP<\/li>\n\n\n\n<li>\u65e0\u5e76\u53d1\u9700\u6c42<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u56db\u3001\u4e00\u53e5\u8bdd\u603b\u7ed3<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>hyperf-wise-locksmith \u4e0d\u662f\u201c\u9501\u201d\uff0c\u800c\u662f\u4e00\u5957\u300c\u5b89\u5168\u4f7f\u7528\u5206\u5e03\u5f0f\u9501\u7684\u6700\u4f73\u5b9e\u8df5\u5c01\u88c5\u300d<\/strong><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u6211\u7528**\u300c\u662f\u4ec0\u4e48 \u2192 \u80fd\u505a\u4ec0\u4e48 \u2192 \u600e\u4e48\u7528 \u2192 \u5178\u578b\u573a\u666f \u2192 \u6ce8\u610f\u4e8b\u9879\u300d**&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2026\/01\/06\/%e8%af%a6%e8%a7%a3php%e4%b8%ad%e4%ba%92%e6%96%a5%e9%94%81%e5%ba%93hyperf-wise-locksmith%e7%9a%84%e4%bd%bf%e7%94%a8\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1246","post","type-post","status-publish","format-standard","hentry","category-php"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=1246"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1246\/revisions"}],"predecessor-version":[{"id":1247,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1246\/revisions\/1247"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=1246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=1246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=1246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}