mirror of
https://github.com/php/php-src.git
synced 2025-01-27 06:03:45 +08:00
5dd41627be
This is specified as the use_function RFC: * https://wiki.php.net/rfc/use_function
27 lines
369 B
PHP
27 lines
369 B
PHP
--TEST--
|
|
import namespaced function
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace foo\bar {
|
|
function baz() {
|
|
return 'foo.bar.baz';
|
|
}
|
|
function qux() {
|
|
return baz();
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
use function foo\bar\baz, foo\bar\qux;
|
|
var_dump(baz());
|
|
var_dump(qux());
|
|
echo "Done\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(11) "foo.bar.baz"
|
|
string(11) "foo.bar.baz"
|
|
Done
|