| Server IP : 138.197.176.125 / Your IP : 216.73.216.41 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/crm_easylife/libraries/antlr/ |
Upload File : |
<?php
//Todo: find a decent set implementation for php
class Set{
public function __construct($arr){
$this->store = array();
foreach($arr as $el){
$this->store[$el] = $el;
}
}
public function add($value){
$this->store[$value] = $value;
}
public function member($value){
return array_key_exists($value, $this->store);
}
public function union($otherSet){
return new Set(array_merge($this->store, $otherSet->store));
}
public function unionInPlace($otherSet){
$this->store = $this->union($otherSet)->store;
}
public function remove($value){
unset($this->store[$value]);
}
}
?>