I found a pretty nice solution myself.
$ar1 = array("hello","world","foo");//equals
$ar2 = array("world","foo","hello");//equals
$ar3 = array("hello","world","bar");//not equal
$ar4 = array();
//Add all items to a single array
$ar4 = array_merge($ar1, $ar2);//equal
//OR
$ar4 = array_merge($ar1, $ar3);//not equal
//Remove all duplicates
//$ar4 = array_unique($ar4); edited due to comment below
$ar4 = array_flip($ar4);
//if you want to user $ar4 later flip it again, its still faster than unique
$ar4 = array_flip($ar4);
$c1 = count($ar1);// = 3
$c4 = count($ar4);// = 3 when the arrays were equal and is > 3 if not
if($c1 === $c4){ //CODE }
So for short this is
$ar1 = array("hello","world","foo");
$ar2 = array("world","foo","hello");
$ar4 = array_merge($ar1, $ar2);
//$ar4 = array_unique($ar4); edited due to comment below
$ar4 = array_flip($ar4);
if(count($ar1) === count($ar4)){ //code }