#!/usr/bin/env php $errno, 'message' => $errstr, 'file' => $errfile, 'line' => $errline, ], TRUE); file_put_contents('error.log', $msg, FILE_APPEND); return true; }, -1); set_exception_handler(static function (mixed $e) { $msg = print_r([ 'code' => $e->getCode(), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'trace' => $e->getTraceAsString(), ], TRUE); file_put_contents('exception.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::new($argc, $argv)->run(); return 0; })($argc, $argv);