我有以下PHP类代码:
class Docx
{
private $namespaces = [
'main' => 'http://schemas.openxmlformats.org/wordprocessingml/2006/main',
'relationships' => 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
];
private $document_references = [
[
'Id' => 'rId5',
'Type' => $this->namespaces['relationships'].'/theme',
'Target' => 'theme/theme1.xml',
],
];
// ...
}
我收到Constant expression contains invalid operations
错误消息,因为我使用了Constant expression contains invalid operations
表达式。
如何引用$namespace['relationships']
值?