Re: [PHP-DEV] sets From: Zeev Suraski (zeev <email protected>)
Date: 05/14/00

If they're well written, then those functions will be accepted. Generally
any function which may be useful for the general public is happily accepted.

Zeev

At 14:33 06/05/2000 , Stig Venaas wrote:
>Hi
>
>I'm writing an PHP4 application where I use sets a lot. The sets are
>arrays, but I only care what values I have in them, not about indices
>and ordering. I use the set operations union, intersection, subtraction
>a lot. I also need to check whether something is an element, that's
>easily done with array_in. I could do union with the array_merge
>function sort of, but I don't want duplicate values. It would help if
>had a function to remove duplicates though, but a specialised union
>would help.
>
>
>Would the following functions be accepted if I wrote them?
>
>array array_union(array array1, array array2)
>Creates an array that contains all values from array1 and array2 without
>any duplicates provided array1 and array2 don't have dups.
>
>array array_intersection(array array1, array array2)
>Creates an array that contains all values that exists both in array1 and
>array2.
>
>array array_subtraction(array array1, array array2)
>Creates an array that contains all values from array1 that is not in
>array2.
>
>The ordering will mostly be preserved, then they are also useful for
>"lists".
>
>
>Should they be named set_ rather than array_?
>
>So what do you say, is this useful?
>
>Stig
>
>--
>Stig Venaas
>UNINETT
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>

--
Zeev Suraski   <zeev <email protected>>  http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>