summaryrefslogtreecommitdiff
path: root/Zend/tests/varSyntax/constant_object_deref.phpt
blob: b25d6557440db2919e029d229f865f051b55b58a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Constants can be dereferenced as objects (even though they can't be objects)
--FILE--
<?php

const FOO = "foo";
class Bar { const FOO = "foo"; }

try {
    FOO->length();
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

try {
    Bar::FOO->length();
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Call to a member function length() on string
Call to a member function length() on string