Arrays

Type initialization / Collections

<?php

//Array of integer
$primeNumbers = [ 2, 3, 5, 7, 11, 13, 17, 19 ];

//Array of string
$gameList = [ "soccer", "hockey", "basketball" ];

//Array of Employee 
$employees = [
    new Employee("Anton", "Pavlov"),
    new Employee("Elena", "Kirienko")
];

class Employee {
    public $firstName;
    public $lastName;

    public function __construct($firstName, $lastName) {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
    }
}

print_r($employees);