Re: [PHP] PHP array unions

2012-09-14 Thread Adam Richardson
On Fri, Sep 14, 2012 at 2:30 AM, Matijn Woudt wrote: > > It doesn't need to be clunky.. just use array_flip and you've got the old > array again.. > Well, array_flip has it's own potential issues (duplicate values are lost, so my example of using zeros would not work.) I suppose I could duplicate

Re: [PHP] PHP array unions

2012-09-13 Thread Matijn Woudt
Op 14 sep. 2012 07:51 schreef "Adam Richardson" het volgende: > > On Wed, Sep 12, 2012 at 2:37 PM, Sebastian Krebs wrote: > > Hi, > > > > In PHP the array is in fact a hash map, but especially it is _used_ for > > nearly everything map-, set-, ...-like thing. So in short: The is no > > operator o

Re: [PHP] PHP array unions

2012-09-13 Thread Adam Richardson
On Wed, Sep 12, 2012 at 2:37 PM, Sebastian Krebs wrote: > Hi, > > In PHP the array is in fact a hash map, but especially it is _used_ for > nearly everything map-, set-, ...-like thing. So in short: The is no > operator or built-in function, that merges two arrays _and_ treat them as > set (instea

Re: [PHP] PHP array unions

2012-09-12 Thread Sebastian Krebs
Hi, In PHP the array is in fact a hash map, but especially it is _used_ for nearly everything map-, set-, ...-like thing. So in short: The is no operator or built-in function, that merges two arrays _and_ treat them as set (instead of the hashmap, what they are). Your solution is the way to g