PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

Ds\Set::contains - Determines if the set contains all values. | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

Ds\Set::contains

(PECL ds >= 1.0.0)

Ds\Set::containsDetermines if the set contains all values.

説明

public bool Ds\Set::contains ([ mixed $...values ] )

Determines if the set contains all values.

注意:

Values of type object are supported. If an object implements Ds\Hashable, equality will be determined by the object's equals function. If an object does not implement Ds\Hashable, objects must be references to the same instance to be considered equal.

警告

All comparisons are strict (type and value).

パラメータ

values

Values to check.

返り値

FALSE if any of the provided values are not in the set, TRUE otherwise.

例1 Ds\Set::contains() example

<?php
$set 
= new \Ds\Set([123]);

var_dump($set->contains(1));                // true
var_dump($set->contains(12));             // true
var_dump($set->contains(...[12]));        // true

var_dump($set->contains("1"));              // false
var_dump($set->contains(...[1234]));  // false

var_dump($set->contains(...[]));            // true
?>

上の例の出力は、 たとえば以下のようになります。

bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(true)

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「Ds\Set::contains - Determines if the set contains all values.」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | Ds\Set::contains - Determines if the set contains all values.」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: