The segmentation fault comes from the recursive pattern ([0-9]+,)* used in the preg_match.
So even if it is a bit slower (0,029 seconds compared to 0,012 seconds with the previous script) I think I prefer the following function. More simple and more readable few months later

, without use of character functions like strlen/mbstrlen.
As the pattern search only for /^[0-9]+$/ we avoid the stack overflow. Thanks for your feedback about this Php issue.
/**
* validListIDs : check the validity of a value separated list of Ids
*/
function validListIDs($IDs){
$groups = explode(',',$IDs);
$nbg = count($groups);
for($i=0;$i<$nbg;$i++)
if (preg_match('/^[0-9]+$/',$groups[$i]) == 0) return false;
return true;
}
Issue registered as
AJAXSEARCH-33
This issue should occur with 1.8.1 and 1.8.2 AjaxSearch releases with a
large number of private documents.
[EDIT: Fixed with AjaxSearch 1.8.3]