<?php
trait Aggregation {
public function callAggregation($method, $arguments) {
var_dump($method, $arguments);
}
}
class AggregateWithUse {
use Aggregation::callAggregation as __call;
}
class AggregateManually {
use Aggregation::callAggregation;
public function __call($method, $arguments) {
$this->callAggregation($method, $arguments);
}
}
{new AggregateWithUse()}->test(42);
{new AggregateManually()}->test(42);