Key differences between Web/Command Line code and GUI's

Consider the following code

<?php
$this
->ui->updateProgress();
$result $this->ui->prompt('Are You sure you want to do that?')
?>