<?php namespace Test\Config { trait Base { public $config = []; function __construct($config = []) { echo 'Constructor'; $this->config = $config; } } } namespace TestB { class Config { use \Test\Config\Base; } } namespace { $test = new TestB\Config(['foo' => 'bar']); echo isset($test->config['foo']) ? 'Success: foo is set' : 'Error: foo is not set'; }
You have javascript disabled. You will not be able to edit any code.