summaryrefslogtreecommitdiff
path: root/Zend/tests/ns_089.phpt
blob: c752eafb3436ae790d0b74ec6103aada5fbc3134 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--TEST--
Group use statements
--FILE--
<?php
namespace Foo\Bar\Baz {
    function foo(){echo __FUNCTION__,"\n";}
    function bar(){echo __FUNCTION__,"\n";}
    const FOO = 0;
    const BAR = 1;
    class A { function __construct() {echo __METHOD__,"\n";} }
    class B { function __construct() {echo __METHOD__,"\n";} }
    class C { function __construct() {echo __METHOD__,"\n";} }
    class D { function __construct() {echo __METHOD__,"\n";} }
}
namespace Fiz\Biz\Buz {

    use Foo\Bar\Baz\{
        A,
        B,
        C as AC,
        D,
        // comment between declarations
        function foo,
        function bar as buz,
        const FOO,
        const BAR AS BOZ
    };

    class C { function __construct() {echo __METHOD__,"\n";}}
    function bar(){echo __FUNCTION__,"\n";}
    const BAR = 100;

    new A;
    new B;
    new AC;
    new D;
    new C;
    foo();
    buz();
    bar();
    var_dump(FOO);
    var_dump(BOZ);
    var_dump(BAR);
}

--EXPECTF--
Foo\Bar\Baz\A::__construct
Foo\Bar\Baz\B::__construct
Foo\Bar\Baz\C::__construct
Foo\Bar\Baz\D::__construct
Fiz\Biz\Buz\C::__construct
Foo\Bar\Baz\foo
Foo\Bar\Baz\bar
Fiz\Biz\Buz\bar
int(0)
int(1)
int(100)