- var_dump: documentation ( source)
<?php
trait Aggregation {
protected function callAggregation($method, $arguments, $problem = FALSE) {
var_dump($method, $arguments, $problem);
}
protected function foo() {
}
}
class AggregateWithUse {
use Aggregation {
Aggregation::callAggregation as public __call;
}
}
class AggregateManually {
use Aggregation;
public function __call($method, $arguments) {
$this->callAggregation($method, $arguments);
}
}
(new AggregateWithUse())->onTest(function() {}, array());
(new AggregateManually())->onTest(function() {});