首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Ds\Deque::__construct

(PECL ds >= 1.0.0)

Ds\Deque::__construct — Creates a new instance.

Description

public Ds\Deque::__construct ([ mixed $values ] )

Creates a new instance, using either a traversable object or an array for the initial values.

Parameters

values

A traversable object or an array to use for the initial values.

Examples

Example #1 Ds\Deque::__construct() example

代码语言:javascript
复制
<?php
$deque?=?new?\Ds\Deque();
var_dump($deque);

$deque?=?new?\Ds\Deque([1,?2,?3]);
var_dump($deque);
?>

The above example will output something similar to:

代码语言:javascript
复制
object(Ds\Deque)#2 (0) {
}
object(Ds\Deque)#2 (3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}

← Ds\Deque::clear

Ds\Deque::contains →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com