['arr', 's(ptr:4_size:4)']
['s', 'ptr:4_size:4']
$re = '/([^\(]+)\(([^(]+)\(([^)]+).*/m';
$str = 'arr(s(ptr:4_size:4))';
$subst = '[\'$1\', \'$2($3)\']\\r\\n[\'$2\', \'$3\']';
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;