Environment

Class
Final: Yes

Reads environment variables through PHP's native runtime.

Table of Contents

Interfaces

EnvironmentInterface

Reads process environment variables without binding callers to Composer APIs.

Methods

get()

Reads an environment variable or the current environment map.

 : array<string, string>|string|null
Methods

get()

Public

Reads an environment variable or the current environment map.

public get([ string|null  $name = null][, string|null  $default = null]) : array<string, string>|string|null
Parameters
$name : string|null = null

Description

the environment variable name, or null to read the current environment map

$default : string|null = null

Description

the value returned when the named variable is not defined

Return values
array<string, string>|string|null

Description

the environment map, variable value, or default fallback