Skip to content

Commit

Permalink
Improve output messaging on examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thgs committed Jan 1, 2024
1 parent 7b53bad commit 62d2f81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/context.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
$timer = EventLoop::repeat(1, function () {
static $i;
$i = $i ? ++$i : 1;
print "Demonstrating how alive the parent is for the {$i}th time.\n";
$nth = $i . ([1 => 'st', 2 => 'nd', 3 => 'rd'][$i] ?? 'th');
print "Demonstrating how alive the parent is for the {$nth} time.\n";
});

try {
Expand Down
3 changes: 2 additions & 1 deletion examples/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
$timer = EventLoop::repeat(1, function () {
static $i;
$i = $i ? ++$i : 1;
print "Demonstrating how alive the parent is for the {$i}th time.\n";
$nth = $i . ([1 => 'st', 2 => 'nd', 3 => 'rd'][$i] ?? 'th');
print "Demonstrating how alive the parent is for the {$nth} time.\n";
});

// This example is identical to context.php, but uses a ProcessContext to demonstrate piping STDOUT
Expand Down

0 comments on commit 62d2f81

Please sign in to comment.