Aer/tests/constants_access.aer

22 lines
490 B
Plaintext
Raw Permalink Normal View History

2019-05-07 08:42:42 +02:00
define TEST_CONSTANT 'This is a global constant';
class Program {
const TEST_CONSTANT = 'This is a class constant';
private void constant_test() {
2019-05-07 08:42:42 +02:00
const TEST_CONSTANT = 'This is a local constant';
var_dump(TEST_CONSTANT);
}
public void main() {
2019-05-07 08:42:42 +02:00
int $var = 69;
var_dump(TEST_CONSTANT);
$this->constant_test();
var_dump(TEST_CONSTANT);
var_dump($this->TEST_CONSTANT);
const TEST_CONSTANT = 'Local constant overrides a global constant';
var_dump(TEST_CONSTANT);
}
}