When your script exits, after ncurses_clear() was called, it could leave your terminal in an inconsistent state.
Therefore, you should call ncurses_savetty() in a constructor and nurses_resetty() in a destructor, to ensure, that your terminal is working fine after your script exits.
Here is an example code snippet, on how to use this function, without falling into trouble ;-)
<? class foo
{
function __construct()
{
ncurses_init();
ncurses_savetty();
}
function bar ()
{
ncurses_clear();
sleep(5);
}
function __destruct()
{
ncurses_resetty();
ncurses_end();
}
}
$test_ncurses = new foo;
$test_ncurses->bar();
?>