<?php
namespace Test {
trait Base {
public $config = [];
function __construct($config = [])
{
$this->config = $config;
}
}
class Config {
use Base;
}
}
namespace {
$test = new Test\Config(['foo' => 'bar']);
echo isset($test->config['foo']) ? 'Success: foo is set' : 'Error: foo is not set';
}