ryoakg
5/21/2016 - 5:48 AM

stdio.php

<?php
// http://php.net/manual/ja/features.commandline.io-streams.php
// http://php.net/manual/ja/book.filesystem.php
// $stdin = fopen('php://stdin', 'r');
$line = fgets(STDIN);
fwrite(STDOUT, $line);
fwrite(STDERR, "\033[31m" . $line . "\033[93m");