If you run your PHP application inside a docker container, you could write (debug) output to the docker log. This is useful if you want to see the output of your application in the docker logs.
Commands
$out = fopen('php://stdout', 'w'); //output handler
fputs($out, "Output goes here...."); //writing output operation
fclose($out); //closing handler
Example
function _log($msg) {
$msg = "myApp - " . date("c") . ": " . $msg."\n";
$out = fopen('php://stdout', 'w');
fputs($out, $msg);
fclose($out);
}