php-src/Zend/tests/use_function/shadow_global.phpt
Igor Wiedler 85d4cfb00d Disallow using functions/consts defined in the same file
* Keep track of defined function and const filenames
* Prohibit use function foo if function foo exists
* Prohibit use const foo if const foo exists
2013-08-25 00:02:46 +02:00

26 lines
346 B
PHP

--TEST--
shadowing a global function with a local version
--FILE--
<?php
namespace {
require 'includes/global_bar.php';
require 'includes/foo_bar.php';
}
namespace {
var_dump(bar());
}
namespace {
use function foo\bar;
var_dump(bar());
echo "Done\n";
}
?>
--EXPECT--
string(10) "global bar"
string(9) "local bar"
Done