3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Aggregation { protected function callAggregation($method, $arguments, $problem = FALSE) { var_dump($method, $arguments); // 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) { $aguments = 'foo'; $this->callAggregation($method, $arguments); } } (new AggregateWithUse())->onTest(function() {}); (new AggregateManually())->onTest(function() {});

preferences:
53.5 ms | 402 KiB | 5 Q