Aer Interpreter Source
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
490 B

define TEST_CONSTANT 'This is a global constant';
class Program {
const TEST_CONSTANT = 'This is a class constant';
private void constant_test() {
const TEST_CONSTANT = 'This is a local constant';
var_dump(TEST_CONSTANT);
}
public void main() {
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);
}
}