Slide 62
Slide 62 text
Sets – Using bitsets (example)
Instead of:
function remove($path, $files = true, $directories = true, $links = true,
$executable = true)
{
if (!$files && is_file($path))
return false;
if (!$directories && is_dir($path))
return false;
if (!$links && is_link($path))
return false;
if (!$executable && is_executable($path))
return false;
// ...
}
remove("/tmp/removeMe", true, false, true, false); // WTF ?!