php-src/Zend/tests/namespace_name_reserved_keywords.phpt
Nikita Popov 7a3dcc3e33 Treat namespaced names as single token
Namespace names are now lexed as single tokens of type
T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED or T_NAME_RELATIVE.

RFC: https://wiki.php.net/rfc/namespaced_names_as_token

Closes GH-5827.
2020-07-22 12:36:05 +02:00

38 lines
495 B
PHP

--TEST--
Reserved keywords in namespace name
--FILE--
<?php
namespace iter\fn {
function test() {
echo __FUNCTION__, "\n";
}
}
namespace fn {
function test() {
echo __FUNCTION__, "\n";
}
}
namespace self {
function test() {
echo __FUNCTION__, "\n";
}
}
namespace {
use iter\fn;
use function fn\test as test2;
use function self\test as test3;
fn\test();
test2();
test3();
}
?>
--EXPECT--
iter\fn\test
fn\test
self\test