#!/usr/bin/php stardit_to_unix($arg), 'unix' => $arg, 'local' => strtotime($arg, time()), }; if ($to === NULL) { $to = match ($from) { 'dit' => 'local', 'local','unix' => 'dit', }; } echo match ($to) { 'dit' => unix_to_stardit($unix), 'unix' => $unix, 'local' => date("Y/m/d H:i:s e", $unix), } . PHP_EOL; } function stream_stdin() { while ($line = fgets(STDIN)) yield $line; }