PHP8 uopz_get_return — 獲取先前設(shè)置的函數(shù)的返回值

2023-10-08 15:10 更新

(PECL uopz 5, PECL uopz 6, PECL uopz 7)

uopz_get_return — 獲取先前設(shè)置的函數(shù)的返回值。

說明

uopz_get_return(string $function): mixed
uopz_get_return(string $class, string $function): mixed

獲取先前由uopz_set_return()設(shè)置的函數(shù)的返回值。

參數(shù)

class

包含函數(shù)的類的名稱。

function

函數(shù)的名稱。

返回值

先前設(shè)置的返回值或閉包。

示例

示例 #1 uopz_get_return() example

<?php
uopz_set_return("strlen", 42);
echo uopz_get_return("strlen");
?>

以上示例會輸出:

42


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號