1--TEST--
2Attributes AST can be exported.
3--INI--
4zend.assertions=1
5assert.exception=0
6assert.warning=1
7--FILE--
8<?php
9
10assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) { }));
11
12assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn () => 1));
13
14assert(0 && ($a = new #[A1] class() {
15    #[A1]#[A2] const FOO = 'foo';
16    #[A2] public $x;
17    #[A3] function a() { }
18}));
19
20assert(0 && ($a = function () {
21    #[A1] class Test1 { }
22    #[A2] interface Test2 { }
23    #[A3] trait Test3 { }
24}));
25
26?>
27--EXPECTF--
28Warning: assert(): assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) {
29})) failed in %s on line %d
30
31Warning: assert(): assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn() => 1)) failed in %s on line %d
32
33Warning: assert(): assert(0 && ($a = new #[A1] class {
34    #[A1]
35    #[A2]
36    public const FOO = 'foo';
37    #[A2]
38    public $x;
39    #[A3]
40    public function a() {
41    }
42
43})) failed in %s on line %d
44
45Warning: assert(): assert(0 && ($a = function () {
46    #[A1]
47    class Test1 {
48    }
49
50    #[A2]
51    interface Test2 {
52    }
53
54    #[A3]
55    trait Test3 {
56    }
57
58})) failed in %s on line %d
59