Sample Test: capture_stdio_1.phpt

Back to "PHPT Test File Layout"

--TEST--
Test covering the all standard I/O streams.
--DESCRIPTION--
This tests checks if the output of stdin, stdout and stderr I/O streams match
the expected content.
--CAPTURE_STDIO--
STDIN STDOUT STDERR
--FILE--
<?php
echo "Hello, world. This is sent to the stdout I/O stream\n";
fwrite(STDERR, "This is error sent to the stderr I/O stream\n");
?>
--EXPECT--
Hello, world. This is sent to the stdout I/O stream
This is error sent to the stderr I/O stream

Back to "PHPT Test File Layout"