Files
nih-php-command-builder/examples/hello-world.php

25 lines
433 B
PHP

<?php
use Nih\CommandBuilder\Command;
require_once __DIR__ . '/../vendor/autoload.php';
$output = (new Command('echo'))
->arg('Hello, World!')
->output();
var_dump($output);
// object(Nih\CommandBuilder\Output)#9 (3) {
// ["stdout"]=>
// string(14) "Hello, World!
// "
// ["stderr"]=>
// string(0) ""
// ["code"]=>
// object(Nih\CommandBuilder\ExitStatus)#8 (1) {
// ["code"]=>
// int(0)
// }
// }