blob: 08b3dddabdf4ee78674281fc5d216768e1f5e422 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--TEST--
ReflectionFunction::getNamespaceName()
--FILE--
<?php
namespace A\B;
function foo() {}
$function = new \ReflectionFunction('sort');
var_dump($function->inNamespace());
var_dump($function->getName());
var_dump($function->getNamespaceName());
var_dump($function->getShortName());
$function = new \ReflectionFunction('A\\B\\foo');
var_dump($function->inNamespace());
var_dump($function->getName());
var_dump($function->getNamespaceName());
var_dump($function->getShortName());
?>
--EXPECT--
bool(false)
string(4) "sort"
string(0) ""
string(4) "sort"
bool(true)
string(7) "A\B\foo"
string(3) "A\B"
string(3) "foo"
|