{"id":73740,"date":"2024-02-26T10:39:58","date_gmt":"2024-02-26T02:39:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/?p=73740"},"modified":"2024-02-26T10:40:13","modified_gmt":"2024-02-26T02:40:13","slug":"php7%e5%8d%93%e8%b6%8a%e6%80%a7%e8%83%bd%e8%83%8c%e5%90%8e%e7%9a%84%e5%8e%9f%e7%90%86%e6%9c%89%e5%93%aa%e4%ba%9b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/73740.html","title":{"rendered":"PHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406\u6709\u54ea\u4e9b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-73741\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/02\/img-gvmH228UVs1YC9aEWEGf7T9u.png?x-oss-process=image\/auto-orient,1\/format,webp\" width=\"600\" height=\"342\" alt=\"PHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406\u6709\u54ea\u4e9b\" \/><\/p>\n<p>### PHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406\u6709\u54ea\u4e9b<\/p>\n<p>\u5728\u8c08\u8bba<strong>PHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406<\/strong>\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u51e0\u4e2a\u6838\u5fc3\u8981\u70b9\uff1a<strong>\u6539\u8fdb\u7684Zend\u5f15\u64ce\u3001\u5185\u5b58\u4f7f\u7528\u4f18\u5316\u3001JIT\u7f16\u8bd1\u5f15\u5165<\/strong>\u3001<strong>\u6570\u636e\u7ed3\u6784\u4f18\u5316<\/strong>\u3002\u8fd9\u4e9b\u6539\u8fdb\u5171\u540c\u4f5c\u7528\uff0c\u4f7fPHP7\u76f8\u6bd4\u4e8ePHP5.6\u5728\u6027\u80fd\u4e0a\u5b9e\u73b0\u4e86\u5de8\u5927\u98de\u8dc3\uff0c\u5177\u4f53\u4f53\u73b0\u5728\u8fd0\u884c\u901f\u5ea6\u63d0\u5347\u7ea6\u4e24\u500d\uff0c\u4ee5\u53ca\u66f4\u4f4e\u7684\u5185\u5b58\u6d88\u8017\u3002<\/p>\n<p><strong>\u6539\u8fdb\u7684Zend\u5f15\u64ce<\/strong>\u662fPHP7\u6027\u80fd\u63d0\u5347\u7684\u5173\u952e\u3002Zend\u5f15\u64ce\u662fPHP\u7684\u6838\u5fc3\uff0c\u8d1f\u8d23\u6267\u884cPHP\u811a\u672c\u3002\u5728PHP7\u4e2d\uff0cZend\u5f15\u64ce\u5347\u7ea7\u5230\u4e86Zend Engine 3\uff0c\u8fd9\u4e2a\u7248\u672c\u4e13\u95e8\u4e3aPHP7\u8bbe\u8ba1\uff0c\u4f18\u5316\u4e86\u6267\u884c\u673a\u5236\u5e76\u51cf\u5c11\u4e86\u5185\u5b58\u6d88\u8017\u3002\u6b64\u5916\uff0cPHP7\u7684Zend\u5f15\u64ce\u5f15\u5165\u4e86\u62bd\u8c61\u8bed\u6cd5\u6811\uff08AST\uff09\uff0c\u8fd9\u662f\u4e00\u4e2a\u5728\u6e90\u4ee3\u7801\u548c\u673a\u5668\u7801\u4e4b\u95f4\u7684\u4e2d\u95f4\u5c42\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u4ee3\u7801\u6267\u884c\u6548\u7387\u5e76\u7b80\u5316\u4ee3\u7801\u7f16\u8bd1\u6d41\u7a0b\u3002<\/p>\n<p>&#8212;<\/p>\n<p>### \u4e00\u3001\u6539\u8fdb\u7684Zend\u5f15\u64ce<\/p>\n<p><strong>PHP7<\/strong>\u7684\u6027\u80fd\u63d0\u5347\u9996\u5148\u5f97\u76ca\u4e8eZend\u5f15\u64ce\u7684\u91cd\u5927\u6539\u8fdb\u3002Zend Engine 3\u91c7\u7528\u4e86\u5168\u65b0\u7684\u6267\u884c\u6a21\u578b\u548c\u5185\u5b58\u7ba1\u7406\u65b9\u5f0f\uff0c\u6781\u5927\u5730\u63d0\u5347\u4e86\u6267\u884c\u6548\u7387\u548c\u5185\u5b58\u4f7f\u7528\u6548\u7387\u3002\u76f8\u6bd4\u4e4b\u524d\u7684\u7248\u672c\uff0c\u5b83\u80fd\u66f4\u5feb\u5730\u6267\u884cPHP\u4ee3\u7801\uff0c\u540c\u65f6\u51cf\u5c11\u5185\u5b58\u6d88\u8017\u3002<\/p>\n<p>\u9996\u5148\uff0cZend Engine 3\u901a\u8fc7\u4f18\u5316\u6267\u884c\u673a\u5236\uff0c\u51cf\u5c11\u4e86\u4e0d\u5fc5\u8981\u7684CPU\u5468\u671f\u6d88\u8017\u3002\u5b83\u5f15\u5165\u4e86\u66f4\u591a\u7684\u91cd\u7528\u7f16\u8bd1\u4ee3\u7801\u7684\u673a\u4f1a\uff0c\u51cf\u5c11\u4e86\u91cd\u590d\u7684\u7f16\u8bd1\u8fc7\u7a0b\u3002\u8fd9\u610f\u5473\u7740\u5bf9\u4e8e\u91cd\u590d\u6267\u884c\u7684\u811a\u672c\uff0cPHP7\u53ef\u4ee5\u66f4\u5feb\u5730\u54cd\u5e94\u3002<\/p>\n<p>\u5176\u6b21\uff0c\u65b0\u7684\u5185\u5b58\u7ba1\u7406\u673a\u5236\u51cf\u5c11\u4e86\u5185\u5b58\u788e\u7247\uff0c\u63d0\u9ad8\u4e86\u5185\u5b58\u4f7f\u7528\u6548\u7387\u3002PHP7\u4e2d\u7684Zend\u5f15\u64ce\u901a\u8fc7\u4f18\u5316\u53d8\u91cf\u5b58\u50a8\u7ed3\u6784\uff0c\u51cf\u5c11\u4e86\u6bcf\u4e2a\u53d8\u91cf\u5360\u7528\u7684\u5185\u5b58\u5927\u5c0f\uff0c\u4ece\u800c\u5141\u8bb8\u66f4\u591a\u7684\u6570\u636e\u5728\u540c\u6837\u5927\u5c0f\u7684\u5185\u5b58\u4e2d\u5b58\u50a8\u3002<\/p>\n<p>### \u4e8c\u3001\u5185\u5b58\u4f7f\u7528\u4f18\u5316<\/p>\n<p><strong>PHP7<\/strong>\u5728\u5185\u5b58\u4f7f\u7528\u4e0a\u7684\u4f18\u5316\u4e5f\u662f\u5176\u6027\u80fd\u5353\u8d8a\u7684\u91cd\u8981\u539f\u56e0\u4e4b\u4e00\u3002\u901a\u8fc7\u6539\u8fdb\u5783\u573e\u56de\u6536\u673a\u5236\u548c\u53d8\u91cf\u5b58\u50a8\u65b9\u5f0f\uff0cPHP7\u80fd\u591f\u66f4\u6709\u6548\u5730\u7ba1\u7406\u5185\u5b58\uff0c\u51cf\u5c11\u5185\u5b58\u6cc4\u9732\uff0c\u4ece\u800c\u63d0\u5347\u6574\u4f53\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<p>PHP7\u4f18\u5316\u4e86\u5783\u573e\u56de\u6536\u673a\u5236\uff0c\u4f7f\u5176\u66f4\u52a0\u667a\u80fd\uff0c\u80fd\u591f\u53ca\u65f6\u6e05\u7406\u4e0d\u518d\u4f7f\u7528\u7684\u5185\u5b58\u3002\u8fd9\u610f\u5473\u7740PHP\u5e94\u7528\u53ef\u4ee5\u957f\u65f6\u95f4\u8fd0\u884c\u800c\u4e0d\u4f1a\u56e0\u4e3a\u5185\u5b58\u6cc4\u9732\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002<\/p>\n<p>\u6b64\u5916\uff0cPHP7\u901a\u8fc7\u4f18\u5316\u6570\u7ec4\u548c\u5bf9\u8c61\u7684\u5b58\u50a8\u7ed3\u6784\uff0c\u51cf\u5c11\u4e86\u5b83\u4eec\u7684\u5185\u5b58\u5360\u7528\u3002\u65b0\u7684\u5b58\u50a8\u673a\u5236\u80fd\u591f\u66f4\u52a0\u7d27\u51d1\u5730\u5b58\u50a8\u6570\u636e\uff0c\u51cf\u5c11\u4e86\u5185\u5b58\u7684\u6d6a\u8d39\uff0c\u4f7f\u5f97\u5373\u4f7f\u662f\u6570\u636e\u5bc6\u96c6\u578b\u7684\u5e94\u7528\u4e5f\u80fd\u8868\u73b0\u51fa\u66f4\u597d\u7684\u6027\u80fd\u3002<\/p>\n<p>### \u4e09\u3001JIT\u7f16\u8bd1\u5f15\u5165<\/p>\n<p><strong>PHP7.4<\/strong>\u5f15\u5165\u7684<strong>JIT\uff08Just In Time\uff09\u7f16\u8bd1<\/strong>\u662f\u53e6\u4e00\u4e2a\u91cd\u5927\u6539\u8fdb\uff0c\u5b83\u5c06PHP\u4ee3\u7801\u5373\u65f6\u7f16\u8bd1\u6210\u673a\u5668\u7801\uff0c\u8fdb\u4e00\u6b65\u63d0\u5347\u4e86\u6267\u884c\u6548\u7387\u3002JIT\u7f16\u8bd1\u80fd\u591f\u5728\u8fd0\u884c\u65f6\u6839\u636e\u4ee3\u7801\u7684\u5b9e\u9645\u4f7f\u7528\u60c5\u51b5\u52a8\u6001\u4f18\u5316\u4ee3\u7801\uff0c\u8fd9\u610f\u5473\u7740PHP\u4ee3\u7801\u80fd\u591f\u4ee5\u63a5\u8fd1\u539f\u751f\u4ee3\u7801\u7684\u901f\u5ea6\u8fd0\u884c\u3002<\/p>\n<p>JIT\u7f16\u8bd1\u7684\u5f15\u5165\uff0c\u7279\u522b\u662f\u5bf9\u4e8eCPU\u5bc6\u96c6\u578b\u7684\u5e94\u7528\uff0c\u80fd\u591f\u663e\u8457\u63d0\u5347\u6027\u80fd\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u51cf\u5c11\u4e86\u89e3\u91ca\u6267\u884c\u7684\u5f00\u9500\uff0c\u5141\u8bb8\u76f4\u63a5\u6267\u884c\u673a\u5668\u7801\u3002\u867d\u7136JIT\u7f16\u8bd1\u5728\u6240\u6709\u573a\u666f\u4e0b\u7684\u6027\u80fd\u63d0\u5347\u5e76\u4e0d\u662f\u7ebf\u6027\u7684\uff0c\u4f46\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u5b83\u80fd\u591f\u63d0\u4f9b\u663e\u8457\u7684\u6027\u80fd\u4f18\u52bf\u3002<\/p>\n<p>### \u56db\u3001\u6570\u636e\u7ed3\u6784\u4f18\u5316<\/p>\n<p>\u5728<strong>PHP7<\/strong>\u4e2d\uff0c\u5bf9\u6570\u636e\u7ed3\u6784\u8fdb\u884c\u4e86\u4f18\u5316\uff0c\u7279\u522b\u662f\u6570\u7ec4\u548c\u54c8\u5e0c\u8868\u7684\u5b9e\u73b0\uff0c\u8fd9\u5bf9\u4e8e\u63d0\u5347PHP\u7684\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002PHP\u4e2d\u5927\u91cf\u4f7f\u7528\u6570\u7ec4\uff0c\u800cPHP7\u901a\u8fc7\u4f18\u5316\u5176\u5185\u90e8\u7ed3\u6784\uff0c\u51cf\u5c11\u4e86\u6570\u7ec4\u64cd\u4f5c\u7684\u5f00\u9500\u3002<\/p>\n<p>\u6570\u7ec4\u5728PHP7\u4e2d\u7684\u5b9e\u73b0\u66f4\u52a0\u9ad8\u6548\uff0c\u5360\u7528\u7684\u5185\u5b58\u66f4\u5c11\uff0c\u8bbf\u95ee\u901f\u5ea6\u66f4\u5feb\u3002\u8fd9\u5f97\u76ca\u4e8e\u5bf9\u6570\u7ec4\u548c\u54c8\u5e0c\u8868\u5e95\u5c42\u7ed3\u6784\u7684\u6539\u8fdb\uff0c\u4f7f\u5f97\u5373\u4f7f\u662f\u5305\u542b\u6570\u5343\u4e2a\u5143\u7d20\u7684\u6570\u7ec4\uff0c\u5176\u6027\u80fd\u4e5f\u5f97\u5230\u4e86\u663e\u8457\u63d0\u5347\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u65b0\u7684\u6570\u636e\u7ed3\u6784\u4f18\u5316\u8fd8\u5305\u62ec\u5bf9\u5bf9\u8c61\u5c5e\u6027\u5b58\u50a8\u7684\u4f18\u5316\uff0c\u8fd9\u4f7f\u5f97\u5bf9\u8c61\u5360\u7528\u7684\u5185\u5b58\u66f4\u5c11\uff0c\u8bbf\u95ee\u901f\u5ea6\u66f4\u5feb\u3002\u8fd9\u5bf9\u4e8e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684PHP\u5e94\u7528\u6765\u8bf4\u662f\u4e00\u4e2a\u5de8\u5927\u7684\u4f18\u52bf\uff0c\u80fd\u591f\u63d0\u5347\u5e94\u7528\u7684\u54cd\u5e94\u901f\u5ea6\u548c\u5904\u7406\u80fd\u529b\u3002<\/p>\n<p>&#8212;<\/p>\n<p>\u603b\u7ed3\u6765\u8bf4\uff0cPHP7\u7684\u6027\u80fd\u4f18\u52bf\u6765\u81ea\u4e8e\u8fd9\u4e9b\u6838\u5fc3\u6539\u8fdb\uff1a\u6539\u8fdb\u7684Zend\u5f15\u64ce\u63d0\u4f9b\u4e86\u66f4\u9ad8\u6548\u7684\u4ee3\u7801\u6267\u884c\u673a\u5236\uff0c\u5185\u5b58\u4f7f\u7528\u7684\u4f18\u5316\u51cf\u5c11\u4e86\u8d44\u6e90\u6d88\u8017\uff0cJIT\u7f16\u8bd1\u5f15\u5165\u4e3aPHP\u4ee3\u7801\u7684\u6267\u884c\u6548\u7387\u63d0\u4f9b\u4e86\u65b0\u7684\u63d0\u5347\u7a7a\u95f4\uff0c\u800c\u6570\u636e\u7ed3\u6784\u7684\u4f18\u5316\u5219\u786e\u4fdd\u4e86\u6570\u636e\u64cd\u4f5c\u7684\u9ad8\u6548\u6027\u3002\u8fd9\u4e9b\u6539\u8fdb\u5171\u540c\u4f5c\u7528\uff0c\u4f7fPHP7\u6210\u4e3a\u4e86\u4e00\u4e2a\u6027\u80fd\u5f3a\u5927\uff0c\u9ad8\u6548\u7387\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u4e3a\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6280\u672f\u652f\u6301\u3002<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>PHP7\u76f8\u6bd4\u4e8e\u4e4b\u524d\u7684\u7248\u672c\u6027\u80fd\u63d0\u5347\u4e3b\u8981\u6765\u6e90\u4e8e\u54ea\u4e9b\u65b9\u9762\uff1f<\/strong><\/p>\n<p>PHP7\u76f8\u6bd4\u4e8e\u4e4b\u524d\u7684\u7248\u672c\u5728\u6027\u80fd\u65b9\u9762\u6709\u4e86\u5de8\u5927\u7684\u63d0\u5347\u3002\u8fd9\u4e3b\u8981\u5f97\u76ca\u4e8ePHP7\u5f15\u5165\u4e86Zend Engine 3.0\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u4f17\u591a\u6027\u80fd\u4f18\u5316\uff0c\u4f8b\u5982\u4f7f\u7528\u4e86\u66f4\u4e3a\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u3001\u589e\u5f3a\u7684\u5185\u5b58\u7ba1\u7406\u3001\u66f4\u597d\u7684\u5f02\u5e38\u5904\u7406\u7b49\u3002\u6b64\u5916\uff0cPHP7\u91c7\u7528\u4e86\u66f4\u4e3a\u5148\u8fdb\u7684JIT\u7f16\u8bd1\u6280\u672f\uff0c\u4f7f\u5f97\u4ee3\u7801\u8fd0\u884c\u66f4\u4e3a\u9ad8\u6548\u3002<\/p>\n<p><strong>PHP7\u6027\u80fd\u63d0\u5347\u80cc\u540e\u7684\u5177\u4f53\u6280\u672f\u539f\u7406\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<p>PHP7\u6027\u80fd\u63d0\u5347\u7684\u6280\u672f\u539f\u7406\u4e3b\u8981\u5305\u62ec\u4e86Zend Engine 3.0\u7684\u4f18\u5316\u548cJIT\u7f16\u8bd1\u6280\u672f\u7684\u5e94\u7528\u3002Zend Engine 3.0\u901a\u8fc7\u63d0\u9ad8\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u6548\u7387\u3001\u4f18\u5316\u5185\u5b58\u7ba1\u7406\u3001\u6539\u8fdb\u5f02\u5e38\u5904\u7406\u673a\u5236\u7b49\u65b9\u5f0f\uff0c\u4f7f\u5f97PHP7\u7684\u6027\u80fd\u5f97\u5230\u4e86\u5927\u5e45\u63d0\u5347\u3002\u800cJIT\u7f16\u8bd1\u6280\u672f\u5219\u53ef\u4ee5\u5c06\u90e8\u5206\u70ed\u70b9\u4ee3\u7801\u5728\u8fd0\u884c\u65f6\u7f16\u8bd1\u6210\u672c\u5730\u673a\u5668\u7801\uff0c\u4ece\u800c\u51cf\u5c11\u4e86\u51fd\u6570\u8c03\u7528\u7684\u5f00\u9500\uff0c\u63d0\u5347\u4e86\u8fd0\u884c\u901f\u5ea6\u3002<\/p>\n<p><strong>PHP7\u7684\u6027\u80fd\u4f18\u5316\u5e26\u6765\u4e86\u54ea\u4e9b\u5177\u4f53\u6548\u679c\uff1f<\/strong><\/p>\n<p>PHP7\u7684\u6027\u80fd\u4f18\u5316\u5e26\u6765\u4e86\u8bb8\u591a\u5177\u4f53\u6548\u679c\uff0c\u5305\u62ec\u4e86\u66f4\u9ad8\u7684\u8fd0\u884c\u901f\u5ea6\u3001\u66f4\u4f4e\u7684\u5185\u5b58\u6d88\u8017\u3001\u66f4\u5feb\u7684\u52a0\u8f7d\u65f6\u95f4\u7b49\u3002\u8fd9\u610f\u5473\u7740\u4f7f\u7528PHP7\u7f16\u5199\u7684\u7a0b\u5e8f\u53ef\u4ee5\u66f4\u5feb\u5730\u54cd\u5e94\u7528\u6237\u8bf7\u6c42\uff0c\u5904\u7406\u66f4\u591a\u7684\u5e76\u53d1\u8fde\u63a5\uff0c\u63d0\u5347\u4e86\u6574\u4f53\u7684\u7cfb\u7edf\u541e\u5410\u91cf\u3002\u6b64\u5916\uff0cPHP7\u7684\u6027\u80fd\u63d0\u5347\u8fd8\u4f7f\u5f97\u539f\u672c\u8fd0\u884c\u8f83\u6162\u7684\u5e94\u7528\u5728\u65b0\u7248\u672c\u4e0b\u53ef\u4ee5\u5f97\u5230\u660e\u663e\u7684\u6539\u5584\uff0c\u4f7f\u5f97\u7528\u6237\u4f53\u9a8c\u5f97\u5230\u4e86\u63d0\u5347\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"### PHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406\u6709\u54ea\u4e9b \u5728\u8c08\u8bbaPHP7\u5353\u8d8a\u6027\u80fd\u80cc\u540e\u7684\u539f\u7406\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u51e0\u4e2a\u6838\u5fc3\u8981\u70b9\uff1a\u6539\u8fdb [&hellip;]","protected":false},"author":1,"featured_media":73743,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/73740"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=73740"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/73740\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/73743"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=73740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=73740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=73740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}