lang/php/ DataStructures


Sets

Sets trivial example

<?php
require_once("Set.php"); // from: https://github.com/jakewhiteley/php-sets
$a = new PhpSets\Set(1,2,3,4,5);
$b = new PhpSets\Set(4,5,6,7,8);
$aub = $a->union($b);
$anb = $a->intersect($b);
$a_b = $a->difference($b);
$b_a = $b->difference($a);
$axb = $a->symmetricDifference($b);