略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: pht\Vector::__construct

2024-12-26

pht\Vector::__construct

(PECL pht >= 0.0.1)

pht\Vector::__constructVector creation

说明

public pht\Vector::__construct ([ int $size = 0 [, mixed $value = 0 ]] ) : Vector

Handles the creation of a new vector.

参数

size

The size of the vector that will be created.

value

The value to initialise the empty slots in the vector to.

返回值

No return value.

范例

Example #1 Creating a new vector

<?php

use pht\Vector;

$vector1 = new Vector(1);
$vector2 = new Vector(21);

var_dump($vector1$vector2);

以上例程会输出:

object(pht\Vector)#1 (1) {
  [0]=>
  int(0)
}
object(pht\Vector)#2 (2) {
  [0]=>
  int(1)
  [1]=>
  int(1)
}
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/pht-vector.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3