What does this program print?
php
<?php
trait ShortLabel
{
public function label(): string { return 'short'; }
}
trait DetailedLabel
{
public function label(): string { return 'detailed'; }
}
final class Labeler
{
use ShortLabel, DetailedLabel {
DetailedLabel::label insteadof ShortLabel;
ShortLabel::label as compactLabel;
}
}
$labeler = new Labeler();
echo $labeler->label(), PHP_EOL;
echo $labeler->compactLabel(), PHP_EOL;