指点云用户44 发表于 2022-7-30 13:31:30

PHP递归算法(四)

<p><span style="font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">在前面的文章中,我们给大家介绍了三种递归算法的实现方法,即“静态变量”、“全局变量”、“引用传参”。需要的朋友可以了解《</span><a href="http://www.php.cn/jishu/php/415619.html" target="_blank" style="margin: 0px; padding: 0px; color: rgb(61, 167, 13); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-line: none !important;">PHP递归算法(一)</a><span style="font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">》《</span><a href="http://www.php.cn/jishu/php/415829.html" target="_blank" style="margin: 0px; padding: 0px; color: rgb(61, 167, 13); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-line: none !important;">PHP递归算法(二)</a><span style="font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">》《</span><a href="http://www.php.cn/jishu/php/415844.html" target="_blank" style="margin: 0px; padding: 0px; color: rgb(61, 167, 13); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-line: none !important;">PHP递归算法(三)</a><span style="font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">》</span></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><br/></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255); text-align: center;"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">下面我们就给大家介绍如何通过xdebug调试运行PHP引用传参的递归算法。</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">代码如下:<br style="margin: 0px; padding: 0px;"/></p><table class="wcn_c_table" cellpadding="0" cellspacing="0" width="760"><tbody style="margin: 0px !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;"><tr style="margin: 0px !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;" class="firstRow"><td class="gutter" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px !important; border-radius: 4px 0px 0px 4px !important; background: none !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(175, 175, 175) !important; user-select: none !important;" width="NaN"><p class="line number1 index0 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">1</p><p class="line number2 index1 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">2</p><p class="line number3 index2 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">3</p><p class="line number4 index3 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">4</p><p class="line number5 index4 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">5</p><p class="line number6 index5 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">6</p><p class="line number7 index6 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">7</p><p class="line number8 index7 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">8</p><p class="line number9 index8 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">9</p><p class="line number10 index9 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">10</p><p class="line number11 index10 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">11</p></td><td class="code" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); word-break: break-all; margin: 0px !important; border-radius: 0px !important; background: none !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; box-sizing: content-box !important; min-height: auto !important;" width="712"><p class="line number1 index0 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&lt;?php</code></p><p class="line number2 index1 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php keyword" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-weight: bold !important; min-height: auto !important;">function</code> <code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">test(</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">=0,&</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$result</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">=</code><code class="php keyword" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-weight: bold !important; min-height: auto !important;">array</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">()){</code></p><p class="line number3 index2 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">++;</code></p><p class="line number4 index3 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-weight: bold !important; min-height: auto !important;">if</code> <code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">(</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&lt;5){</code></p><p class="line number5 index4 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$result</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">[]=</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">;</code></p><p class="line number6 index5 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">test(</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">,</code><code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$result</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">);</code></p><p class="line number7 index6 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">}</code></p><p class="line number8 index7 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php functions" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">echo</code> <code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$a</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">.</code><code class="php string" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&lt;hr&gt;</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">;</code></p><p class="line number9 index8 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php spaces" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="php keyword" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-weight: bold !important; min-height: auto !important;">return</code> <code class="php variable" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">$result</code><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">;</code></p><p class="line number10 index9 alt1" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">}</code></p><p class="line number11 index10 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="php plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">var_dump(test());</code></p></td></tr></tbody></table><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">首先在test方法体内的第一行创建一个断点。<br style="margin: 0px; padding: 0px;"/></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">然后点击向下箭头,开始调试“跑”程序。</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">第一次判断循环如下:</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">最后一次判断循环如下:<br style="margin: 0px; padding: 0px;"/></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">最后输出如下:</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p><br/></p><link rel="stylesheet" href="//www.zhidianyun.cn/source/plugin/wcn_editor/public/wcn_editor_fit.css?v134_TZ8" id="wcn_editor_css"/>
页: [1]
查看完整版本: PHP递归算法(四)