1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/Zend/tests/varSyntax/constant_object_deref.phpt
2020-02-11 12:33:23 +01:00

25 lines
428 B
PHP

--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