GoLang pht\Vector::__construct

request it (363)
GoLang replacement for PHP's pht\Vector::__construct [edit | history]



Do you know a GoLang replacement for PHP's pht\Vector::__construct? Write it!

PHP pht\Vector::__construct

PHP original manual for pht\Vector::__construct [ show | php.net ]

pht\Vector::__construct

(PECL pht >= 0.0.1)

pht\Vector::__constructVector creation

Description

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

Handles the creation of a new vector.

Parameters

size

The size of the vector that will be created.

value

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

Return Values

No return value.

Examples

Example #1 Creating a new vector

<?php

use pht\Vector;

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

var_dump($vector1$vector2);

The above example will output:

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