What Will Be The Output Of The Following Php Codep Pre Langphp #360
What will be the output of the following PHP code?</p> <pre><code class="language-php" line="1"> class Checkout { final function totalize() { // calculate bill } } class IllegalCheckout extends Checkout { final function totalize() { // change bill calculation } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 Objects and Databases - PHP Object Advanced Features - Quiz No.3.
What will be the output of the following PHP code?
class Checkout { final function totalize() { // calculate bill } } class IllegalCheckout extends Checkout { final function totalize() { // change bill calculation } }
PHP Fatal error: Class IllegalCheckout may not inherit from final class
Value of the bill calculated
PHP Fatal error: Cannot find object
PHP Fatal error: Cannot override final method