Block visibility depending on node type

With this code in the block visibility settings, the block appears only when a node is viewed of type xxx.

<?php
if (arg(0) == 'node' && is_numeric(arg(1)) &&
   ($node = node_load(array('nid' => arg(1)))) && $node->type == 'xxx') {
   return TRUE;
}
return FALSE;
?>

Reference: http://drupal.org/node/64135