| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
Ds\Map::put(PECL ds >= 1.0.0) Ds\Map::put — Associates a key with a value. 説明
Associates a
警告
Be careful when using array syntax. Scalar keys will be coerced to
integers by the engine. For example, See Arrays. パラメータ
返り値値を返しません。 例例1 Ds\Map::put() example
<?php 上の例の出力は、 たとえば以下のようになります。 Ds\Map Object ( [0] => Ds\Pair Object ( [key] => a [value] => 1 ) [1] => Ds\Pair Object ( [key] => b [value] => 2 ) [2] => Ds\Pair Object ( [key] => c [value] => 3 ) ) 例2 Ds\Map::put() example using objects as keys
<?php 上の例の出力は、 たとえば以下のようになります。 object(Ds\Map)#1 (5) { [0]=> object(Ds\Pair)#7 (2) { ["key"]=> object(ArrayIterator)#2 (1) { ["storage":"ArrayIterator":private]=> array(0) { } } ["value"]=> int(2) } [1]=> object(Ds\Pair)#8 (2) { ["key"]=> object(stdClass)#3 (0) { } ["value"]=> int(3) } [2]=> object(Ds\Pair)#9 (2) { ["key"]=> object(stdClass)#4 (0) { } ["value"]=> int(4) } [3]=> object(Ds\Pair)#10 (2) { ["key"]=> object(HashableObject)#5 (1) { ["value":"HashableObject":private]=> int(1) } ["value"]=> int(6) } [4]=> object(Ds\Pair)#11 (2) { ["key"]=> object(HashableObject)#6 (1) { ["value":"HashableObject":private]=> int(2) } ["value"]=> int(8) } } |
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Ds\Map::put - Associates a key with a value.」をGoogle検索
|