Quote:
Originally Posted by Inverness
Too complex for average use.
|
But Powerful for those who know how to use it. Additionally, the merger comes with a default way of merging. It isn't necessary to define your own function, but the power is there if you do!
PHP Code:
function onCreated()
{
mod1 = TMap.newInstance({{"a",3}, {"b", 1}} );
mod2 = TMap.newInstance({{"a",2}, {"b", 1}, {"c", 1}} );
mod3 = TMap.merge( mod1, mod2 );
echo( mod3.toArray() ); // "a,5","b,2","c,1"
}
Simple for those who don't need more.