mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
5dd41627be
This is specified as the use_function RFC: * https://wiki.php.net/rfc/use_function
31 lines
442 B
PHP
31 lines
442 B
PHP
--TEST--
|
|
aliasing imported functions to resolve naming conflicts
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace foo {
|
|
function baz() {
|
|
return 'foo.baz';
|
|
}
|
|
}
|
|
|
|
namespace bar {
|
|
function baz() {
|
|
return 'bar.baz';
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
use function foo\baz as foo_baz,
|
|
bar\baz as bar_baz;
|
|
var_dump(foo_baz());
|
|
var_dump(bar_baz());
|
|
echo "Done\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(7) "foo.baz"
|
|
string(7) "bar.baz"
|
|
Done
|