note 52027 added to language.oop5.patterns
| From: | richard dot quadling at bandvulc dot co dot uk | Date: | Tue, 19 Apr 2005 12:29:14 +0000 |
| Subject: | note 52027 added to language.oop5.patterns | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88205@lists.php.net to get a copy of this message | ||
Singletons and subclasses will fail because __construct has to be public SOMEWHERE in the base class
and cannot be hidden in sub classes. Even if the base class is an abstract class (which helps a
little).
You can get abstract base class and singleton sub class working fine EXCEPT that you can create an
instance of the subclass if you use new class(); rather than class::singleton();
So. After many hours of trial and error, no mixing of singletons and subclasses.
----
Manual Page -- http://www.php.net/manual/en/language.oop5.patterns.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52027
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52027&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52027&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52027&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52027&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52027&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52027&report=yes
Search -- http://master.php.net/manage/user-notes.php