update to PHP-8.1
[m6w6/seekat] / examples / cli.php
1 #!/usr/bin/env php
2 <?php
3
4 $api = include "examples.inc";
5
6 array_shift($argv);
7
8 ($self = function($api) use(&$self) {
9 global $argv;
10
11 while (null !== ($arg = array_shift($argv))) {
12 if ("." === $arg) {
13 $api->then($self);
14 return;
15 }
16 $api = $api->$arg;
17 }
18
19 echo $api, "\n";
20 })($api);
21
22 $api->send();