W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
(PECL runkit7 >= Unknown)
runkit7_function_redefine — 將函數(shù)定義替換為新的實(shí)現(xiàn)
runkit7_function_redefine(
string $function_name,
string $argument_list,
string $code,
bool $return_by_reference = null,
string $doc_comment = null,
string $return_type = ?,
bool $is_strict = ?
): bool
runkit7_function_redefine(
string $function_name,
Closure $closure,
string $doc_comment = null,
string $return_type = ?,
bool $is_strict = ?
): bool
注意: 默認(rèn)情況下,僅在用戶空間可刪除,重命名,或者修改函數(shù)。為了覆蓋內(nèi)部函數(shù),必須啟用 php.ini 中的 runkit.internal_override 設(shè)置。
function_name
要重新定義的函數(shù)的名稱
argument_list
要由函數(shù)接受的新參數(shù)列表
code
新的代碼實(shí)現(xiàn)
closure
定義函數(shù)的閉包。
return_by_reference
該函數(shù)是否應(yīng)返回引用。
doc_comment
函數(shù)的文檔注釋。
return_type
函數(shù)的返回類型。
is_strict
函數(shù)是否表現(xiàn)得像在文件中聲明了 strict_types=1 一樣。
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。
示例 #1 A runkit7_function_redefine() example
<?php
function testme() {
echo "Original Testme Implementation\n";
}
testme();
runkit7_function_redefine('testme','','echo "New Testme Implementation\n";');
testme();
?>
以上示例會(huì)輸出:
Original Testme Implementation
New Testme Implementation
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: