prefix constant

Documentation for prefix constant assembled from the following types:

language documentation Variables

From Variables

(Variables) prefix constant

The constant prefix declares that a container value is not going to change during its lifetime.

constant $pi2 = pi * 2;
$pi2 = 6# OUTPUT: «(exit code 1) Cannot assign to an immutable value␤ 

The value is assigned at compile time. Please check the section on constants in the Terms page for additional information.