Ok...the docs are a bit vague when it comes to an abstract
class extending another abstract class. An abstract class
that extends another abstract class doesn't need to define
the abstract methods from the parent class. In other words,
this causes an error:
[php]
abstract class class1 {
abstract public function someFunc();
}
abstract class class2 extends class1 {
abstract public function someFunc();
}
[/php]
Error: Fatal error: Can't inherit abstract function
class1::someFunc() (previously declared abstract in class2)
in /home/sneakyimp/public/chump.php on line 7
However this does not:
[php]
abstract class class1 {
abstract public function someFunc();
}
abstract class class2 extends class1 {
}
[/php]
An abstract class that extends an abstract class can pass
the buck to its child classes when it comes to implementing
the abstract methods of its parent abstract class.
----
Server IP: 69.147.83.197
Probable Submitter: 76.174.207.198
----
Manual Page -- http://www.php.net/manual/en/language.oop5.abstract.php
a>
Edit -- https://master
.php.net/note/edit/78388
Del: integrated -- h
ttps://master.php.net/note/delete/78388/integrated
Del: useless -- http
s://master.php.net/note/delete/78388/useless
Del: bad code -- htt
ps://master.php.net/note/delete/78388/bad+code
Del: spam -- https:/
/master.php.net/note/delete/78388/spam
Del: non-english --
https://master.php.net/note/delete/78388/non-english
Del: in docs -- http
s://master.php.net/note/delete/78388/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78388
Reject -- https://mast
er.php.net/note/reject/78388
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|