Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unicode Set Functions
<?php
const= true;
const= false;
function ≠($left, $right) {
return $left != $right;
}
function ≅($left, $right) {
return ($left > $right - 0.0001) && ($left < $right + 0.0001);
}
function ≡($left, $right) {
return $left === $right;
}
function ≢($left, $right) {
return $left !== $right;
}
<?php
function ∅() {
return array();
}
function ∃($value, array $set) {
return false !== array_search($value, $set, true);
}
function ∄($value, array $set) {
return false === array_search($value, $set, true);
}
function ∩(array $set1, array $set2) {
return array_intersect($set1, $set2);
}
function ∪(array $set1, array $set2) {
return array_merge($set1, $set2);
}
function ⊂(array $subset, array $superset) {
return $subset == ∩($subset, $superset);
}
function ⊃(array $superset, array $subset) {
return ⊂($subset, $superset);
}
function ⊄(array $subset, array $superset) {
return !⊂($subset, $superset);
}
function ⊅(array $superset, array $subset) {
return !⊂($subset, $superset);
}
@afarazit

This comment has been minimized.

afarazit commented Feb 6, 2013

Fun !

@YOzaz

This comment has been minimized.

YOzaz commented Jan 16, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment