« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 12 for Hashable (0.001 sec.)
The Hashable interface | PHP 8.3 11939
The Hashable interface (PECL ds >= 1.0.0) はじめに Hashable is an interface which allows objects to be used as keys. It's an alternative to spl_object_hash() , which determines an object's hash based on its handle: this means that two objec ... aranteed that the comparing object will be an instance of the same class as the subject. インターフェイス概要 interface Ds\Hashable { /* メソッド */ abstract public function equals ( object $obj ): bool abstract public function hash (): mixed } 目次 Ds\H ... ashable::equals — Determines whether an object is equal to the current instance Ds\Hashable::hash — Returns a scalar value to be used as a hash value 他のマニュアルの関連ページ Linux JM hash(3) Linux JM pthread_equ ...
https://man.mtool.work/php/8.3/class.ds-hashable.html
Ds\Hashable::hash — Returns a scalar value to be used as a hash value | PHP 8.3 11656
Ds\Hashable::hash (PECL ds >= 1.0.0) Ds\Hashable::hash — Returns a scalar value to be used as a hash value 説明 abstract public function Ds\Hashable::hash (): mixed Returns a scalar value to be used as the hash value of the objects. While t ... he hash value does not define equality, all objects that are equal according to Ds\Hashable::equals() must have the same hash value. Hash values of equal objects don't have to be unique, for example you could just ... e. パラメータ この関数にはパラメータはありません。 戻り値 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 __co ...
https://man.mtool.work/php/8.3/ds-hashable.hash.html
Ds\Hashable::equals — Determines whether an object is equal to the current inst... 11178
Ds\Hashable::equals (PECL ds >= 1.0.0) Ds\Hashable::equals — Determines whether an object is equal to the current instance 説明 abstract public function Ds\Hashable::equals ( object $obj ): bool Determines whether another object is equal to ... j is an instance of the same class. 警告 It's important that objects which are equal also have the same hash value. See Ds\Hashable::hash() . パラメータ obj The object to compare the current instance to, which is always an instance of the same class. 戻り ...
https://man.mtool.work/php/8.3/ds-hashable.equals.html
Ds\Set::add — Adds values to the set | PHP 8.3 9286
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 haven't already been added. 注意 : 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 ... 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 $v ... 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 -> ...
https://man.mtool.work/php/8.3/ds-set.add.html
Ds\Map::put — Associates a key with a value | PHP 8.3 8914
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 a key with a value , overwriting a previous association if one exists. 注意 : Keys 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 ... 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 $v ... 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 ...
https://man.mtool.work/php/8.3/ds-map.put.html
Ds\Map::putAll — Associates all key-value pairs of a traversable object or arra... 8242
Ds\Map::putAll (PECL ds >= 1.0.2) Ds\Map::putAll — Associates all key-value pairs of a traversable object or array 説明 public function Ds\Map::putAll ( mixed $pairs ): void Associates all key-value pairs of a traversable object or array . ... 注意 : Keys 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 ...
https://man.mtool.work/php/8.3/ds-map.putall.html
Ds\Set::contains — Determines if the set contains all values | PHP 8.3 8154
Ds\Set::contains (PECL ds >= 1.0.0) Ds\Set::contains — Determines if the set contains all values 説明 public function Ds\Set::contains ( mixed ...$values ): bool Determines if the set contains all values. 注意 : Values of type object are su ... pported. 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 ...
https://man.mtool.work/php/8.3/ds-set.contains.html
Ds\Map::remove — Removes and returns a value by key | PHP 8.3 7959
Ds\Map::remove (PECL ds >= 1.0.0) Ds\Map::remove — Removes and returns a value by key 説明 public function Ds\Map::remove ( mixed $key , mixed $default = ? ): mixed Removes and returns a value by key, or return an optional default value if ... the key could not be found. 注意 : Keys 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 ...
https://man.mtool.work/php/8.3/ds-map.remove.html
Ds\Map::get — Returns the value for a given key | PHP 8.3 7871
Ds\Map::get (PECL ds >= 1.0.0) Ds\Map::get — Returns the value for a given key 説明 public function Ds\Map::get ( mixed $key , mixed $default = ? ): mixed Returns the value for a given key, or an optional default value if the key could not ... be found. 注意 : Keys 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 ...
https://man.mtool.work/php/8.3/ds-map.get.html
Data Structures | PHP 8.3 7676
Data Structures はじめに Efficient data structures for PHP 7, provided as an alternative to the array . See » this blog post for benchmarks, discussion and frequently asked questions. インストール/設定 要件 インストール手順 例 Ds\Collection ... lection::isEmpty — Returns whether the collection is empty Ds\Collection::toArray — Converts the collection to an array Ds\Hashable — The Hashable interface Ds\Hashable::equals — Determines whether an object is equal to the current instance Ds\Hashable:: ...
https://man.mtool.work/php/8.3/book.ds.html
PREV 1 2 NEXT