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