mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
7a3dcc3e33
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.
38 lines
495 B
PHP
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
|