#!/usr/bin/env php $e->getCode(), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'trace' => $e->getTraceAsString(), ], TRUE); file_put_contents('kilo.log', $msg, FILE_APPEND); }); // ! Init with an IIFE return (static function (int $argc, array $argv): int { Termios::enableRawMode(); register_shutdown_function([Termios::class, 'disableRawMode']); $editor = Editor::new(); $editor->setStatusMessage('HELP: Ctrl-S = save | Ctrl-Q = quit | Ctrl-F = find'); if ($argc >= 2) { $editor->open($argv[1]); } // Input Loop do { $editor->refreshScreen();} while ($editor->processKeypress() !== NULL); return 0; })($argc, $argv);