This should work:
<?php
$comments = array();
$selectors = preg_replace_callback('~\*(?>(?:(?>([^*]+))|\*(?!\/))*)\*~',
function ($match) use (&$comments) { //add the variable $comments to the function scope
$comments[] = $match[0];
return '';
}, $input);
?>