<span style="margin: 0px; color: #000088; vertical-align: baseline; border-width: 0px; padding: 0px;" class="kwd">function</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> aa</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">$str</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">)</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> </span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">{</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> echo $str</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">;</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> </span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">}</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> $function </span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">=</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> </span><span style="margin: 0px; color: #008800; vertical-align: baseline; border-width: 0px; padding: 0px;" class="str">"aa"</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">;</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> $function</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #008800; vertical-align: baseline; border-width: 0px; padding: 0px;" class="str">'Hello'</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">);</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> </span><span style="margin: 0px; color: #880000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="com">// OR</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> call_user_func</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">$function</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">,</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> $param</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">);</span>
ログイン後にコピー
2. すべての関数をリストし、特定の関数が存在するかどうかを判断します
<span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">get_defined_functions</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">()</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> function_exist</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">()</span>
ログイン後にコピー
3. PUT リクエストを受け入れます。PHP REST が必要です
<span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">parse_str</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">file_get_contents</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #008800; vertical-align: baseline; border-width: 0px; padding: 0px;" class="str">'php://input'</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">),</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> $put_vars</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">);</span>
ログイン後にコピー
4. 文字列
からの解析時間<span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">echo date</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #008800; vertical-align: baseline; border-width: 0px; padding: 0px;" class="str">'Y-m-d'</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">,</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> strtotime</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #008800; vertical-align: baseline; border-width: 0px; padding: 0px;" class="str">'-1 month ago'</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">));</span>
ログイン後にコピー
5. デバッグ コール バックトレースを表示します
<span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> $backtrace </span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">=</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> debug_backtrace</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">();</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> var_export</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">(</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">$backtrace</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">[</span><span style="margin: 0px; color: #006666; vertical-align: baseline; border-width: 0px; padding: 0px;" class="lit">0</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">])</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> </span><span style="margin: 0px; color: #000088; vertical-align: baseline; border-width: 0px; padding: 0px;" class="kwd">die</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">();</span>
ログイン後にコピー
6. 対話型コマンドライン、コマンドライン実行 PHP
php -a および php -r ‘echo “hello”;’
詳細については、php -h
を参照してください。7. メモリ使用量の検出
<span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln">memory_get_peak_usage</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">()</span><span style="margin: 0px; color: #000000; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pln"> memory_get_usage</span><span style="margin: 0px; color: #666600; vertical-align: baseline; border-width: 0px; padding: 0px;" class="pun">()</span>
ログイン後にコピー