- array_diff: documentation ( source)
<?php
$test = array( 'permissions2', 'this2', 'test', 'jabab');
$toost = array('permissions2', 'test', 'this2');
$yo = array_diff($toost, $test);
if (array_diff($toost, $test) || array_diff($test, $toost))
echo 'false';
else
echo 'true';