Q:

Am I allowed to put single quoted, double quoted heredoc syntax or nowdoc syntax strings directly into a functions parameter that uses a string?

Am I allowed to put single quoted, double quoted heredoc syntax or nowdoc syntax strings directly into functions whose parameters require a string like for example strlen('string text') or strlen("some more string text") instead of including a variable for example strlen($str);?
If not why?

A:

You are allowed to do that unless function expects string variable to be passed by reference:
// '&' means that argument is passed by reference
function requestStringAsVariable(&$str) {
    $str = '*' . $str . '*';
}

$str = 'test';
requestStringAsVariable($str);
echo $str; // outputs '*test*';

requestStringAsVariable('foo'); // won't work, as function expects variable

