Opposite of flattenList().
It needs at least a single separator to be present in all values
as the key would otherwise be undefined. If data can contain such key-less
rows, use $undefinedKey to avoid an exception being thrown. But it will
effectivly collide with other values in that same key then.
So Some.Deep.Value becomes array('Some' => array('Deep' => array('Value'))).
/** * UtilityTest::testExpandListWithKeyLessList() * * @return void */ public function testExpandListWithKeyLessList() { $is = ['Some', 'Thing', '.EmptyString']; $result = Utility::expandList($is, '.', ''); $expected = ['' => ['Some', 'Thing', 'EmptyString']]; $this->assertSame($expected, $result); }