💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
# 方法的重载覆盖 php是弱类型语言不支持重载 ``` <pre class="calibre17">``` class <span class="token4">Test</span> <span class="token3">{</span> <span class="token5">function</span> <span class="token4">__construct</span><span class="token3">(</span><span class="token3">)</span> <span class="token3">{</span> $num <span class="token1">=</span><span class="token4">func_num_args</span><span class="token3">(</span><span class="token3">)</span><span class="token3">;</span> switch <span class="token3">(</span>$num<span class="token3">)</span> <span class="token3">{</span> case <span class="token6">0</span><span class="token3">:</span> echo <span class="token2">"none "</span><span class="token3">;</span> <span class="token5">break</span><span class="token3">;</span> case <span class="token6">1</span><span class="token3">:</span> echo <span class="token2">"one "</span><span class="token3">;</span> <span class="token5">break</span><span class="token3">;</span> case <span class="token6">2</span><span class="token3">:</span> echo <span class="token2">"two "</span><span class="token3">;</span> <span class="token5">break</span><span class="token3">;</span> <span class="token3">}</span> <span class="token3">}</span> <span class="token3">}</span> <span class="token5">new</span> <span class="token4">Test</span><span class="token3">(</span><span class="token3">)</span><span class="token3">;</span> <span class="token5">new</span> <span class="token4">Test</span><span class="token3">(</span><span class="token6">1</span><span class="token3">)</span><span class="token3">;</span> <span class="token5">new</span> <span class="token4">Test</span><span class="token3">(</span><span class="token6">1</span><span class="token3">,</span><span class="token6">2</span><span class="token3">)</span><span class="token3">;</span> ``` ```