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

  1. define TEST_CONSTANT 'This is a global constant';
  2. class Program {
  3. const TEST_CONSTANT = 'This is a class constant';
  4. private void constant_test() {
  5. const TEST_CONSTANT = 'This is a local constant';
  6. var_dump(TEST_CONSTANT);
  7. }
  8. public void main() {
  9. int $var = 69;
  10. var_dump(TEST_CONSTANT);
  11. $this->constant_test();
  12. var_dump(TEST_CONSTANT);
  13. var_dump($this->TEST_CONSTANT);
  14. const TEST_CONSTANT = 'Local constant overrides a global constant';
  15. var_dump(TEST_CONSTANT);
  16. }
  17. }