函式名: Ds\Pair::isEmpty()
函式描述: isEmpty() 方法用於檢查 Pair 物件是否為空。
用法:
public function isEmpty(): bool
示例:
use Ds\Pair;
$pair = new Pair('key', 'value');
// 檢查 Pair 物件是否為空
if ($pair->isEmpty()) {
echo "Pair 物件為空";
} else {
echo "Pair 物件不為空";
}
輸出:
Pair 物件不為空
版本要求: 使用 Ds\Pair 類及其 isEmpty() 方法需要 PHP 7.3 或更高版本。