View Single Post
Old 02-27-2008, 05:45 PM   #1 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default Function overwriting

Is it possible(maybe in php future) that when you extend a class that you can disable function overwriting or does it apply to the final class php5 uses?

Code:
class x
{
   final function base()
   {
       echo 'main';
   }
}
class y extends x
{
   function base()
   {
       echo 'main2';
   }
}
will it error out or is it possible to stop the error and allow access to the root class without overwriting that function.

Code:
$cls = new y();
$cls->base();//would this output main?
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote