pushContext($context); $this->updatePrompt(); $this->addTimer(5000, function () { echo "5 seconds\n"; }); } protected function updatePrompt() { $this->setPrompt("test[{$this->seq}]: "); } protected function onCommand($buffer) { $this->seq++; $this->updatePrompt(); parent::onCommand($buffer); } } $myShell = new MyShell(); $myShell->run(); echo "Exiting\n";