minte9
LearnRemember



Class constants

Class constants are public, and accessible from all scopes.
 
class A
{
    const BAR = "Hello World";
}

echo A::BAR; // Hello World
Class constants can be define as array.
 
class A
{
    const BAR = array(1, 2, 3);
}

print_r(A::BAR); // [1, 2, 3]



  Last update: 432 days ago