xref: /PHP-7.4/Zend/tests/traits/bug60717.phpt (revision d679f022)
1--TEST--
2Bug #60717 (Order of traits in use statement can cause unexpected unresolved abstract method)
3--FILE--
4<?php
5
6namespace HTML
7{
8	interface Helper
9	{
10		function text($text);
11		function attributes(array $attributes = null);
12		function textArea(array $attributes = null, $value);
13	}
14
15	trait TextUTF8
16	{
17		function text($text) {}
18	}
19
20	trait TextArea
21	{
22		function textArea(array $attributes = null, $value) {}
23		abstract function attributes(array $attributes = null);
24		abstract function text($text);
25	}
26
27	trait HTMLAttributes
28	{
29		function attributes(array $attributes = null) {	}
30		abstract function text($text);
31	}
32
33	class HTMLHelper implements Helper
34	{
35		use TextArea, HTMLAttributes, TextUTF8;
36	}
37
38	class HTMLHelper2 implements Helper
39	{
40		use TextArea, TextUTF8, HTMLAttributes;
41	}
42
43	class HTMLHelper3 implements Helper
44	{
45		use HTMLAttributes, TextArea, TextUTF8;
46	}
47
48	class HTMLHelper4 implements Helper
49	{
50		use HTMLAttributes, TextUTF8, TextArea;
51	}
52
53	class HTMLHelper5 implements Helper
54	{
55		use TextUTF8, TextArea, HTMLAttributes;
56	}
57
58	class HTMLHelper6 implements Helper
59	{
60		use TextUTF8, HTMLAttributes, TextArea;
61	}
62
63	$o = new HTMLHelper;
64    $o = new HTMLHelper2;
65    $o = new HTMLHelper3;
66    $o = new HTMLHelper4;
67    $o = new HTMLHelper5;
68    $o = new HTMLHelper6;
69    echo 'Done';
70}
71--EXPECT--
72Done
73