Memory App
Programming
 




Class constants are public, and accessible from all scopes.

<?php
    class foo {
        const BAR = "Hello World";
    }
    echo foo::BAR; // outputs Hello World
Class constants have the same limitations as normal constants.

<?php
    class foo {
        const ARR = array(); // Arrays are not allowed in class constants 
    }


Questions



Top Reference > Programming