« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 6 of about 6 for HashableObject (0.001 sec.)
Adds values to the set 10656
« Ds\Set Ds\Set::allocate » PHP Manual Ds\Set Adds values to the set 検索 Ds\Set::add (PECL ds >= 1.0.0) Ds\Set::add — Adds values to the set 説明 public function Ds\Set::add ( mixed ...$values ): void Adds all given values to the set that ... nt(1) [1]=> int(2) [2]=> int(3) [3]=> string(1) "1" [4]=> bool(true) } 例2 Ds\Set::add() example using objects <?php class HashableObject implements \Ds\Hashable { /** * An arbitrary value to use as the hash value. Does not define equality. */ private $value ; ... t will add them all. $set -> add (new \stdClass ()); $set -> add (new \stdClass ()); // Adding multiple instances of equal hashable objects will only add the first. $set -> add (new \HashableObject ( 1 )); $set -> add (new \HashableObject ( 1 )); $set -> add ( ... new \HashableObject ( 2 )); $set -> add (new \HashableObject ( 2 )); var_dump ( $set ); ?> 上の例の出力は、 たとえば以下のようになります。 obj ...
https://man.mtool.work/php/8.3/ds-set.add.html
Adds values to the set 10656
« Ds\Set Ds\Set::allocate » PHP Manual Ds\Set Adds values to the set 検索 Ds\Set::add (PECL ds >= 1.0.0) Ds\Set::add — Adds values to the set 説明 public function Ds\Set::add ( mixed ...$values ): void Adds all given values to the set that ... nt(1) [1]=> int(2) [2]=> int(3) [3]=> string(1) "1" [4]=> bool(true) } 例2 Ds\Set::add() example using objects <?php class HashableObject implements \Ds\Hashable { /** * An arbitrary value to use as the hash value. Does not define equality. */ private $value ; ... t will add them all. $set -> add (new \stdClass ()); $set -> add (new \stdClass ()); // Adding multiple instances of equal hashable objects will only add the first. $set -> add (new \HashableObject ( 1 )); $set -> add (new \HashableObject ( 1 )); $set -> add ( ... new \HashableObject ( 2 )); $set -> add (new \HashableObject ( 2 )); var_dump ( $set ); ?> 上の例の出力は、 たとえば以下のようになります。 obj ...
https://man.mtool.work/php/8.3/ds-set.add.html
Associates a key with a value 10181
« Ds\Map::pairs Ds\Map::putAll » PHP Manual Ds\Map Associates a key with a value 検索 Ds\Map::put (PECL ds >= 1.0.0) Ds\Map::put — Associates a key with a value 説明 public function Ds\Map::put ( mixed $key , mixed $value ): void Associates ... ue] => 2 ) [2] => Ds\Pair Object ( [key] => c [value] => 3 ) ) 例2 Ds\Map::put() example using objects as keys <?php class HashableObject implements \Ds\Hashable { /** * An arbitrary value to use as the hash value. Does not define equality. */ private $value ; ... associations. $map -> put (new \stdClass (), 3 ); $map -> put (new \stdClass (), 4 ); // Using multiple instances of equal hashable objects will overwrite previous values. $map -> put (new \HashableObject ( 1 ), 5 ); $map -> put (new \HashableObject ( 1 ), 6 ) ... ; $map -> put (new \HashableObject ( 2 ), 7 ); $map -> put (new \HashableObject ( 2 ), 8 ); var_dump ( $map ); ?> 上の例の出力は、 たとえば以下のようになりま ...
https://man.mtool.work/php/8.3/ds-map.put.html
Associates a key with a value 10181
« Ds\Map::pairs Ds\Map::putAll » PHP Manual Ds\Map Associates a key with a value 検索 Ds\Map::put (PECL ds >= 1.0.0) Ds\Map::put — Associates a key with a value 説明 public function Ds\Map::put ( mixed $key , mixed $value ): void Associates ... ue] => 2 ) [2] => Ds\Pair Object ( [key] => c [value] => 3 ) ) 例2 Ds\Map::put() example using objects as keys <?php class HashableObject implements \Ds\Hashable { /** * An arbitrary value to use as the hash value. Does not define equality. */ private $value ; ... associations. $map -> put (new \stdClass (), 3 ); $map -> put (new \stdClass (), 4 ); // Using multiple instances of equal hashable objects will overwrite previous values. $map -> put (new \HashableObject ( 1 ), 5 ); $map -> put (new \HashableObject ( 1 ), 6 ) ... ; $map -> put (new \HashableObject ( 2 ), 7 ); $map -> put (new \HashableObject ( 2 ), 8 ); var_dump ( $map ); ?> 上の例の出力は、 たとえば以下のようになりま ...
https://man.mtool.work/php/8.3/ds-map.put.html
Returns a scalar value to be used as a hash value 6562
« Ds\Hashable::equals Ds\Sequence » PHP Manual Ds\Hashable Returns a scalar value to be used as a hash value 検索 Ds\Hashable::hash (PECL ds >= 1.0.0) Ds\Hashable::hash — Returns a scalar value to be used as a hash value 説明 abstract publi ... はありません。 戻り値 A scalar value to be used as this object's hash value. 例 例1 Ds\Hashable::hash() example <?php class HashableObject implements \Ds\Hashable { private $name ; private $email ; public function __construct ( $name , $email ) { $this -> name ...
https://man.mtool.work/php/8.3/ds-hashable.hash.html
Returns a scalar value to be used as a hash value 6562
« Ds\Hashable::equals Ds\Sequence » PHP Manual Ds\Hashable Returns a scalar value to be used as a hash value 検索 Ds\Hashable::hash (PECL ds >= 1.0.0) Ds\Hashable::hash — Returns a scalar value to be used as a hash value 説明 abstract publi ... はありません。 戻り値 A scalar value to be used as this object's hash value. 例 例1 Ds\Hashable::hash() example <?php class HashableObject implements \Ds\Hashable { private $name ; private $email ; public function __construct ( $name , $email ) { $this -> name ...
https://man.mtool.work/php/8.3/ds-hashable.hash.html
PREV 1 NEXT