W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PECL runkit7 >= Unknown)
runkit7_function_add — 添加一個新函數(shù),類似于 create_function()。
runkit7_function_add(
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_add(
string $function_name,
Closure $closure,
string $doc_comment = null,
string $return_type = ?,
bool $is_strict = ?
): bool
function_name
要創(chuàng)建的函數(shù)的名稱。
argument_list
逗號分隔的參數(shù)列表。
code
構(gòu)成該函數(shù)的代碼。
closure
定義函數(shù)的閉包。
return_by_reference
函數(shù)是否應(yīng)該返回引用。
doc_comment
函數(shù)的文檔注釋。
return_type
函數(shù)的返回類型。
is_strict
函數(shù)是否應(yīng)該表現(xiàn)得像在 ?strict_types=1
? 的文件中聲明一樣。
成功時返回 true, 或者在失敗時返回 false。
示例 #1 A runkit7_function_add() example
<?php
runkit7_function_add('testme','$a,$b','echo "The value of a is $a\n"; echo "The value of b is $b\n";');
testme(1,2);
?>
以上示例會輸出:
The value of a is 1
The value of b is 2
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: