array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'ds-set.construct.php', 1 => 'Ds\\Set::__construct', ), 'up' => array ( 0 => 'class.ds-set.php', 1 => 'Ds\\Set', ), 'prev' => array ( 0 => 'ds-set.clear.php', 1 => 'Ds\\Set::clear', ), 'next' => array ( 0 => 'ds-set.contains.php', 1 => 'Ds\\Set::contains', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/set/construct.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ds >= 1.0.0)
Ds\Set::__construct — Creates a new instance
Creates a new instance, using either a traversable
object or an array for the initial values
.
values
A traversable object or an array to use for the initial values.
Örnek 1 Ds\Set::__construct() example
<?php
$set = new \Ds\Set();
var_dump($set);
$set = new \Ds\Set([1, 2, 3]);
var_dump($set);
?>
Yukarıdaki örnek şuna benzer bir çıktı üretir:
object(Ds\Set)#1 (0) { } object(Ds\Set)#2 (3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }