mirror of
https://github.com/php/php-src.git
synced 2026-04-25 17:08:14 +02:00
3b08f53c97
As an exception, we allow "Type $foo = null" to occur before a required parameter, because this pattern was used as a replacement for nullable types in PHP versions older than 7.1. Closes GH-5067.
73 lines
1.5 KiB
PHP
73 lines
1.5 KiB
PHP
--TEST--
|
|
Bug #60717 (Order of traits in use statement can cause unexpected unresolved abstract method)
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace HTML
|
|
{
|
|
interface Helper
|
|
{
|
|
function text($text);
|
|
function attributes(array $attributes = null);
|
|
function textArea(?array $attributes, $value);
|
|
}
|
|
|
|
trait TextUTF8
|
|
{
|
|
function text($text) {}
|
|
}
|
|
|
|
trait TextArea
|
|
{
|
|
function textArea(?array $attributes, $value) {}
|
|
abstract function attributes(array $attributes = null);
|
|
abstract function text($text);
|
|
}
|
|
|
|
trait HTMLAttributes
|
|
{
|
|
function attributes(array $attributes = null) { }
|
|
abstract function text($text);
|
|
}
|
|
|
|
class HTMLHelper implements Helper
|
|
{
|
|
use TextArea, HTMLAttributes, TextUTF8;
|
|
}
|
|
|
|
class HTMLHelper2 implements Helper
|
|
{
|
|
use TextArea, TextUTF8, HTMLAttributes;
|
|
}
|
|
|
|
class HTMLHelper3 implements Helper
|
|
{
|
|
use HTMLAttributes, TextArea, TextUTF8;
|
|
}
|
|
|
|
class HTMLHelper4 implements Helper
|
|
{
|
|
use HTMLAttributes, TextUTF8, TextArea;
|
|
}
|
|
|
|
class HTMLHelper5 implements Helper
|
|
{
|
|
use TextUTF8, TextArea, HTMLAttributes;
|
|
}
|
|
|
|
class HTMLHelper6 implements Helper
|
|
{
|
|
use TextUTF8, HTMLAttributes, TextArea;
|
|
}
|
|
|
|
$o = new HTMLHelper;
|
|
$o = new HTMLHelper2;
|
|
$o = new HTMLHelper3;
|
|
$o = new HTMLHelper4;
|
|
$o = new HTMLHelper5;
|
|
$o = new HTMLHelper6;
|
|
echo 'Done';
|
|
}
|
|
--EXPECT--
|
|
Done
|