This question has been answered by m.engel. See the first response.
<?php return "Hello world!";
<?php echo "Hello world!"; return '';
<?php $output = "Hello world!"; return $output;
$output = '<p>Line one</p>'; $output .= '<p>Line two</p>'; $output .= '<p>Line three</p>'; return $output;
$output = '';
<?php
$docSize = $modx->getOption('docSize', $scriptProperties, 0);
if ($docSize > 50) {
$output = 'Large';
} elseif ($docSize < 50) {
$output = 'Small';
}
return $output;
$myArray = array();