Sample Test: capture_stdio_1.phpt

Back to "PHPT Test File Layout"

--TEST--
Test covering the I/O stdin and stdout streams.
--DESCRIPTION--
This tests checks if the output of stdin and stdout I/O streams match the
expected content.
--CAPTURE_STDIO--
STDIN 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--
This is error sent to the stderr I/O stream

Back to "PHPT Test File Layout"